css - 设置默认 WordPress 搜索框的样式

标签 css wordpress

我无法弄清楚是什么导致提交按钮和搜索框的输入区域之间出现空白。
/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/

相关文章:

javascript - Bootstrap 4 导航下拉悬停在桌面上/点击移动设备

wordpress - 将私有(private)页面重定向到先登录,然后在 Wordpress 中显示页面

php - 使用 jQuery 解析 Ajax 响应

java - 找不到在 Scene Builder 中添加的 CSS StyleSheet

javascript - IE7 - 设置 Javascript 生成元素的样式

javascript - 折叠多个导航栏 Bootstrap

javascript - 如何使用javascript将YouTube视频嵌入到wordpress中

javascript - jquery toggle img 单击并在单击时从本地存储中存储或删除 img id

php - 将自定义字段添加到 WooCommerce 订单项目

css - 无法让字体在 wordpress 上工作