0

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

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

我像这样生成那个按钮

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


火狐把它变成这样

<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>

我用于 topsearch 的 CSS 是:

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

有人可以帮我吗?

4

3 回答 3

0

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

#topsearch{
    font-size:0px;
}
于 2013-06-19T17:48:29.533 回答
0

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

 <!-- 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 --> 
于 2013-06-19T17:09:16.703 回答
0

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

#topsearch在和之间的行末尾,它似乎是一个不可见的空格字符#search

<div id="topsearch">
                     
    <div id="search">
        <form method="get" id="searchform" action="http://dian.7u.cz/">
于 2013-06-21T09:38:10.500 回答