【问题标题】:Search box and submit button not aligned in CSS搜索框和提交按钮在 CSS 中未对齐
【发布时间】:2013-09-10 16:34:54
【问题描述】:

我在我的 wordpress 网站上添加了一个搜索框,但由于 wordpress 中有很多默认样式,我似乎无法让 bot 框和提交按钮对齐。

目前提交按钮的起始位置比我的搜索框高一点,尽管我没有为我的按钮指定任何边距或内边距..

网站在这里上线; http://sennheiser-apart.com

这些是我目前在我的子主题的 css 文件中搜索内容的 css 行。

button {
    border:none;
    padding:6px;
}

input {
    height:28px;
    border:none;
}

input[type="submit"]{
    border:none;
    background-color:#00AFDD;
    height:28px;
    color:#fff;
    font-size:18px;
    margin:0px;
}

input[type="submit"]:hover{
    background-color:#ADAFB2;
}

即使在我的页面上搜索并在 wordpress 使用的其他文件中寻找一行样式也无济于事,我只是找不到导致这种情况的原因。有人有线索吗?我怎样才能解决这个问题?

【问题讨论】:

    标签: html css search wordpress-theming


    【解决方案1】:

    不用看太多细节,您可以将其添加到<form>-元素:

    padding: 5px 0 0 0;
    

    并在<input>-elements 中添加:

    vertical-align: top;
    

    这应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-09
      • 2014-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-05
      相关资源
      最近更新 更多