I have a script that erases the default value text in the form when the user clicks in the field, but how can I make the value text appear in italics? If I change the input in my css to font-style:italic then when the user types it appears in italics too and I just want the "preview text" to be in italics and then normal when the user is typing.
Asked
Active
Viewed 7,738 times
1 Answers
10
You need to use a different selector for each engine, unfortunately.
#box::-webkit-input-placeholder { font-style: italic; }
#box::-ms-input-placeholder { font-style: italic; }
#box::-moz-placeholder { font-style: italic; }

Ry-
- 218,210
- 55
- 464
- 476