<input type="text" placeholder="search word" name="p" />
但是在chrome下显示的search word并不能垂直居中。
后来找了很久终于在stackoverflow上找到了对应的方法。
参考:http://stackoverflow.com/questions/4919680/html5-placeholder-css-padding-problem
就是一句:把line-height设置为normal
line-height: normal; /* for non-ie */
line-height: 22px\9; /* for ie */
so fix it...

本文探讨了在Chrome浏览器中HTML5占位符样式无法垂直居中的问题,并提供了在StackOverflow找到的解决方案。通过将line-height属性设置为'normal'或特定值,可以解决此问题。

2765

被折叠的 条评论
为什么被折叠?



