2011-06-03 152 views
2

我有一個佈局問題只在IE8的負邊界奇怪的事情。IE8負利潤率問題

我曾嘗試使用我在此論壇中找到的一些修復程序,但無濟於事。畢竟這是星期五晚上!

的頁面是在這裏:http://community.thelandtrust.org.uk/wordpress/

罪魁禍首是在右手側,具有負裕量,以按鈕坐在了它在同一條線上搜索領域。

它工作正常,除了IE8。在IE8中,右邊距爲-80px,按鈕位於該區域,但右邊有一個大的空間。在右邊距爲-40px的情況下,按鈕位於下一行,並且右側的空間仍然很大。

我注意到,它似乎每次都與右側的距離相同。這是清算問題嗎?

在此先感謝您提供的任何幫助!

的代碼:

<form action="http://community.thelandtrust.org.uk/wordpress/" id="search-form" class="search-form" method="get"> 
    <div> 
     <input type="text" onblur="if(this.value=='')this.value=this.defaultValue;" onfocus="if(this.value==this.defaultValue)this.value='';" value="Search..." id="search-text" name="s" class="search-text"> 
     <input type="submit" value="Go" id="search-submit" name="submit" class="search-submit button"> 
    </div> 
</form> 

的CSS:

input,textarea { 
    background:#f7f9e0 url(images/Input_gradient.jpg) repeat-x top left; 
    border:none; 
    -moz-border-radius:20px; 
    border-radius:20px; 
    vertical-align:middle; 
    min-height:20px; 
    width:94%; 
    font-family:Arial, sans-serif; 
    font-size:1em; 
    padding:10px 20px; 
} 
input.button,input#submit { 
    background:#e6e99d url(images/Button_gradient.jpg) repeat-x bottom left; 
    height:40px; 
    width:auto; 
    min-width:40px; 
    font-weight:700; 
    cursor:pointer; 
    float:right; 
} 
input.button:hover,input#submit:hover,#primary-menu li a:hover { 
    background:#c7cc5c; 
} 
form#search-form{ 
    overflow: hidden; 
} 
input.search-text { 
    margin-right: -80px; 
    width: 200px; 
    float:left; 
    font-size: 1.2em; 
} 
input.search-submit { 
    background:url(images/Button_arrow_40px.png) no-repeat 0 0 transparent!important; 
    width:40px; 
    text-indent:-1000px; 
    font-size: 0; 
    display:block; 
    line-height: 0; 
    float:right; 
    clear:right; 
} 
input.search-submit:hover { 
    background-position:0 -40px!important; 
} 
+0

工作正常,我在IE7中,或在IE7模式至少IE9。至少,按鈕位置很好。盒子的邊角不圓,但是 – Jason 2011-06-03 21:14:12

+0

謝謝@Jason!感覺相當愚蠢,因爲我剛剛意識到問題出在IE8上...... – 2011-06-04 08:42:24

回答

2

由於某種原因IE8正在使按鈕雙倍寬度。

加入padding: 0;input.search-submit似乎解決它

+0

非常感謝您的快速回復! – 2011-06-04 09:03:36