How to set placeholder value using CSS?

后端 未结 9 1311
天涯浪人
天涯浪人 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:26

    From what I understand using,

    ::-webkit-input-placeholder::beforeor ::-webkit-input-placeholder::after,

    to add more placeholder content doesn't work anymore. Think its a new Chrome update.

    Really annoying as it was a great workaround, now im back to just adding lots of empty spaces between lines that I want in a placeholder. eg:

    
    

提交回复
热议问题