【问题标题】:Chrome bug in wordpress search formwordpress 搜索表单中的 Chrome 错误
【发布时间】:2013-06-21 17:38:10
【问题描述】:

我只是在使用 WordPress CMS 的网站上工作。
在 IE、Firefox、Opera 等浏览器上运行正常,但在 Chrome 上不行。

在 Firefox 中的站点 http://dian.7u.cz 上,搜索表单处于良好位置,但在 Chrome 上,它位于真实位置下方。

我像这样生成那个按钮

<div id="topsearch">
<?php get_search_form(); ?>
</div>


Firefox 是这样的

<div id="topsearch">
  <div id="search">
    <form id="searchform" action="http://localhost/wordpress/" method="get">
      <input id="s" type="text" onfocus="if (this.value == 'Hľadať') {this.value = '';}" onblur="if (this.value == '')  {this.value = 'Hľadať';}" name="s" value="Hľadať">    
      </input>
      <input type="image" style="border:0; vertical-align: top;"src="http://localhost/wordpress/wp-content/themes/GamesMax/GamesMax/images/search.gif">
      </input>
    </form>
  </div>
</div>

但是 Chrome 是这样的

<div id="topsearch">
 ""

  <div id="search">
    <form id="searchform" action="http://localhost/wordpress/" method="get">
      <input id="s" type="text" onfocus="if (this.value == 'Hľadať') {this.value = '';}" onblur="if (this.value == '')  {this.value = 'Hľadať';}" name="s" value="Hľadať">    
      </input>
      <input type="image" style="border:0; vertical-align: top;"src="http://localhost/wordpress/wp-content/themes/GamesMax/GamesMax/images/search.gif">
      </input>
    </form>
  </div>
</div>

我的顶级搜索 css 是:

#topsearch {
    text-align:left;
    float:right;
    margin-bottom: 0;
    margin-right: 17px;
    margin-top: 9px;
}

有人可以帮我吗?

【问题讨论】:

    标签: css wordpress google-chrome


    【解决方案1】:

    尝试使您的搜索表单如下所示:

     <!-- Search Box Begin-->
    <div class="searchbox">
    <form method="get" id="navsearchform" action="<?php bloginfo('url'); ?>/">
    <input type="text" class="search-text" value="" name="s"  />
    <input type="submit" value="Go">
    </form>
    </div>
    <!-- Search Box End --> 
    

    【讨论】:

      【解决方案2】:

      我通过向 css 添加一个小技巧来修复它:

      #topsearch{
          font-size:0px;
      }
      

      【讨论】:

        【解决方案3】:

        再次检查您的header.phpsearchform.php 模板,确保没有不可见的空格或制表符。

        #topsearch#search 之间的行尾似乎是一个不可见的空格字符。

        <div id="topsearch">
                             
            <div id="search">
                <form method="get" id="searchform" action="http://dian.7u.cz/">
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-08-26
          • 2014-06-09
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-12-18
          • 2012-10-10
          相关资源
          最近更新 更多