How to set placeholder value using CSS?

后端 未结 9 1289
天涯浪人
天涯浪人 2020-12-16 09:00

I want to set the placeholder value of an input box using only css and not JavaScript or jQuery. How can I do this?

9条回答
  •  粉色の甜心
    2020-12-16 09:25

    As @Sarfraz already mentioned CSS, I'll just add HTML5 to the mix.

    You can use the HTML5 placeholder attribute:

    
    

提交回复
热议问题