JsFiddle 问题在于占位符,当我将字体大小设置得更高时,看起来不对,检查jsfiddle,文本看起来分成两半。
<input type="text" id="txtSearch" placeholder="Search" />
#txtSearch {
width:1050px;
height:35px;
background-color:#605784;
border-width:0px;
}
::-webkit-input-placeholder {
color: White;
font-family:'Open Sans', sans-serif;
font-size:15pt;
position:relative;
top:-5px;
}
答案 0 :(得分:0)
checkout this solution from stackoverflow 输入及其占位符必须具有匹配的字体样式
input,
::-webkit-input-placeholder {
color: White;
font-family:'Open Sans', sans-serif;
font-size:15pt;
position:relative;
top:-5px;
}