How to style the placeholder in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to style the placeholder in html

I have used the following code for modifying the default styles of placeholder. but still ther are no modifications. the code is ::-webkit-input-placeholder { /* Chrome/Opera/Safari */ color: pink; } ::-moz-placeholder { /* Firefox 19+ */ color: pink; } :-ms-input-placeholder { /* IE 10+ */ color: pink; } :-moz-placeholder { /* Firefox 18- */ color: pink; }

22nd Dec 2017, 5:45 AM
Bhavani Sankar
Bhavani Sankar - avatar
7 Answers
+ 5
strange it works fine for me ,how about showing me your code https://code.sololearn.com/WevG5aY9PjfU/?ref=app
22nd Dec 2017, 6:03 AM
Leon lit
Leon lit - avatar
+ 4
please show us your code so we can help you if there's a error in it ,if you don't it's hard for us to help you ......
22nd Dec 2017, 7:18 AM
Leon lit
Leon lit - avatar
+ 2
how about you try this input::placeholder { color: red; }
22nd Dec 2017, 5:50 AM
Leon lit
Leon lit - avatar
+ 2
@Leon your code works on my side.
22nd Dec 2017, 6:26 AM
Calviղ
Calviղ - avatar
0
I have tried that but no change
22nd Dec 2017, 5:55 AM
Bhavani Sankar
Bhavani Sankar - avatar
0
Have a look here. This should help explain things. https://css-tricks.com/almanac/selectors/p/placeholder/
22nd Dec 2017, 7:00 AM
Nope
Nope - avatar
0
thank u
26th Dec 2017, 6:58 AM
Bhavani Sankar
Bhavani Sankar - avatar