Reputation:
How can we change the color of placeholder of selected input fields.
input[type="text"].smInput{
color: #333;
}
Upvotes: 0
Views: 75
Reputation:
input:-moz-placeholder, textarea:-moz-placeholder{
color: #222;
}
input::-webkit-input-placeholder, textarea::-moz-placeholder{
color: #222;
}
Upvotes: 1
Reputation: 155618
The placeholder text is exposed to CSS as a pseudo-element, so use the pseudo-element selector. It hasn't yet been standardised, so you need to repeat the selector for the layout-engines that support it:
input[type=text].smInput::-moz-placeholder,
input[type=text].smInput:-ms-input-placeholder, /* IE uses a pseudo-class rather than pseudo-element */
input[type=text].smInput::-webkit-input-placeholder, {
color: #333;
}
Source:
Upvotes: 1
Reputation:
input[type="text"].smInput:-moz-placeholder, textarea:-moz-placeholder{
color: #222;
}
input[type="text"].smInput::-webkit-input-placeholder, textarea::-moz-placeholder{
color: #222;
}
Upvotes: 0