Html5输入框支持placeholder,可是在定义文本框中定义placeholder存在兼容问题css
<input type="text" placeholder="search word" name="p" />
可是在chrome下显示的search word并不能垂直居中。html
在stackoverflow上找到了对应的方法。参考地址:http://stackoverflow.com/questions/4919680/html5-placeholder-css-padding-problemhtml5
解决方法是:chrome
把line-height设置为normalspa
CSS定义以下code
input{ line-height: normal; /* for non-ie */ line-height: 22px\9; /* for ie */ }