【发布时间】:2011-08-11 22:03:58
【问题描述】:
我遇到了一个小问题,<div> 之间出现了双边距。它在 FF、Opera、Safari 等中运行良好,但在 IE6 和 IE7 中运行良好(令人惊讶)。
应该有一个左浮动的<div>,旁边是一个右浮动的<div>,然后在下面有另一个左撇子和右撇子。它们之间只有 24 像素,但在 IE6 和 7 中只有 47 像素。
HTML:
<div id="content">
<div id="contentwrapper">
<div class="infobox leftinfo row1">
<div class="searchForm">
</div>
</div>
<div class="infobox rightinfo row1">
<div class="searchForm">
</div>
</div>
<div class="infobox leftinfo row2">
<div class="textstuff">
</div>
</div>
<div class="infobox rightinfo row2">
<div class="textstuff">
</div>
</div>
</div>
</div>
CSS:
#contentwrapper{
padding:23px;
}
#content{
background-image:url(../img/contentbg.jpg);
border: 1px solid #81b8de;
-moz-box-shadow: 0 0 8px 5px #80cafe;
-webkit-box-shadow: 0 0 8px 5px #80cafe;
box-shadow: 0 0 8px 5px #80cafe;
behavior: url(/sponster/PIE.htc);
position:relative;
}
.infobox{
border: 1px solid #4eed4e;
background:url(../img/infoboxbg.png) repeat-x;
height:100%;
-moz-box-shadow: 0 0 12px -1px #406020;
-webkit-box-shadow: 0 0 12px -1px #406020;
box-shadow: 0 0 12px -1px #406020;
behavior: url(/sponster/PIE.htc);
position:relative;
}
.leftinfo{
float:left;
width:442px;
margin-bottom:24px;
}
.rightinfo{
float:right;
width:442px;
margin-bottom:24px;
}
注意row1 类就是这样一个 JavaScript 文件可以确保每个并排的 <div> 的高度相同。这是一个 jQuery 插件:http://www.cssnewbie.com/equalheights-jquery-plugin,它似乎没有任何问题。
有什么想法我哪里出错了吗?
【问题讨论】:
标签: html css internet-explorer-7 internet-explorer-6