I want to italicize the placeholder of a html input textbox. I am trying to achieve it using pseudo-elements in css. I am observing a strange behavior. When the pseudo elements are in a single line it does not work i.e. the placeholder text is not in italic, and when the pseudo-elements are in different lines, it works.
I have created a fiddle (http://jsfiddle.net/aniruddha/VZ43T/3) to demonstrate the problem. Version 2 of the same fiddle demonstrates the working code
Not working:
.filterBox::-webkit-input-placeholder, .filterBox::-moz-placeholder, .filterBox::-ms-input-placeholder {
font-style: italic;
}
Working:
.filterBox::-webkit-input-placeholder {
font-style: italic;
}
.filterBox::-moz-placeholder {
font-style: italic;
}
.filterBox::-ms-input-placeholder {
font-style: italic;
}
Why doesn't it work when pseudo-elements are in the same line? CSS Validator (http://jigsaw.w3.org/css-validator/validator) says that both the css are valid for CSS Level 3.
Thanks, Aniruddha