Computer Science, asked by Limon9066, 10 months ago

How to change an HTML5 input's placeholder color with CSS?

Answers

Answered by lastbenchstudent
0

to change color of placeholder text you have apply css, for that user pseudo element ::placeholder element

this all behaves different in different browser

<input type="text" placeholder="write name here" name="name"/>

::-webkit-input-placeholder { /* Chrome/Opera/Safari */

 color: red;

}

::-moz-placeholder { /* Firefox 19+ */

 color: red;

}

:-ms-input-placeholder { /* IE 10+ */

 color: red;

}

:-moz-placeholder { /* Firefox 18- */

 color: red;

}

Similar questions