2013-06-19 28 views
0

我只是在網站上使用WordPress CMS進行開發。
在IE中,Firefox,Opera和其他瀏覽器可以正常工作,但Chrome瀏覽器沒有。

現場http://dian.7u.cz在Firefox中搜索表單處於良好狀態,但在Chrome上它是在真實位置下行。在wordpress搜索表單中的Chrome bug

我生成這樣

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

我的CSS爲卓爲:

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

有人能幫助我嗎?

回答

0

我加入少許的黑客CSS固定它:

#topsearch{ 
    font-size:0px; 
} 
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 --> 
0

查看您所在header.phpsearchform.php模板再次並確保有是不可見的空間或製表符。

看起來像是在#topsearch#search之間的一行末尾看不見的空格字符。

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