How can i change the font-color of an input
text box without affecting the placeholder
font color in Internet Explorer 11?
If i change the color of the font in an input (Fiddle):
HTML:
<div class="buttonToolbar">
<input type="text" placeholder="e.g. Stackoverflow"><br>
</div>
CSS:
.buttonToolbar input {
color: Blue;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
font-style: italic;
color: GrayText;
}
::-webkit-input-placeholder { /* WebKit browsers */
font-style: italic;
color: GrayText;
}
The placeholder text is no longer it's default gray-ish color in Internet Explorer 11:
But it does display as i would like in Chrome 35:
Bonus Chatter
If i don't style the input
box, then the input box is not styled. Changing:
.buttonToolbar input {
color: Blue;
}
to
.buttonToolbar {
color: Blue;
}
means that the placeholder text now does what it is supposed to to:
but now the text color does not do what it is supposed to do:
What i need is figure out how to change an input's HTML5 placeholder color with CSS.