How do I change md-input-container placeholder color using css in Angular Material? As screenshot below I have phone no. and password textfield. Phone no. textfield has Phone No. and password has Password placeholder name.
Placeholder is depicted as a <label>
in Angular Material. So you actually need to style the label not the placeholder.
As soon as you click (focus) on the input this <label>
which is looking as a placeholder slides up and converted into a form <label>
.
So you just need to apply this CSS:
/* When the input is not focused */
md-input-container label {
color: red;
}
/* When the input is focused */
md-input-container.md-input-focused label {
color: blue;
}
Have a look at this Plunkr Demo.