且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Webkit中的HTML5,占位符,行高

更新时间:2023-01-07 16:54:17

看看你的标签,我假设你写的是...... ...

Looking at your tags, I'm assuming you are writing something like...

<input type="text" placeholder="whatever">

不幸的是,当涉及到占位符的样式时,Chrome会牵制你的手,选择器看起来像这样。 。

Unfortunately, Chrome ties your hands when it comes to styling the placeholder, the selector looks like this...

input::-webkit-input-placeholder {}

您可以在为HTML占位符设置样式