2011-06-03 173 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