gpt4 book ai didi

html - 容器 div 额外边距 ie6

转载 作者:行者123 更新时间:2023-11-28 14:37:32 26 4
gpt4 key购买 nike

<div id="container">
<div id="content">
<div class="halfLeft"></div>
<div class="halfRight"></div>
</div>
</div>

#container{ width:960px;margin:auto; background-image:url(../img/contentbg.jpg);}
.halfLeft{font: 1.5em BrushcutRegular; background:url(../img/halfbg.png) no-repeat;margin:12px 0px 12px 12px;float:left;width:468px;height:336px;}
.halfRight{font: 1.5em BrushcutRegular; background:url(../img/halfbg.png) no-repeat;margin:12px 12px 12px 0px;float:right;width:468px;height:336px;}

出于某种原因,这使得 #container 在 IE6 的左侧添加了一个额外的 12px ...

有什么问题吗?

最佳答案

我认为您应该向#content 添加一些样式:

padding: 12px;
overflow: hidden; /* Floating fix for modern browsers */
zoom: 1; /* Floating fix for IE */

并从 .halfLeft 和 .halfRight 中移除边距。

关于html - 容器 div 额外边距 ie6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6557187/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com