我无法弄清楚是什么导致提交按钮和搜索框的输入区域之间出现空白。
/image/2DuDq.png
html:
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<p><input type="text" class="field" name="s" id="s" placeholder="Search" />
<input type="submit" class="submit" name="submit" value="Traži" /></p>
CSS:
#searchform {
float: right;
padding-top: 10px;
position: relative;
}
header input#s {
margin: 0;
border: none;
height: 29px;
width: 250px;
}
header input:active {
border: none;
}
header input.submit {
border: none;
height: 30px;
width: 30px;
margin: 0;
text-indent: -99999px;
background: white url(images/search.png) 0 0 no-repeat;
padding-right:20px;
}
最佳答案
http://jsfiddle.net/butuzov/MCtc3/
使用 font-size:0 作为父元素(在您的情况下为 p)或避免输入元素之间有空格
关于css - 设置默认 WordPress 搜索框的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9855631/