IE6中背景颜色隐藏浮动内容的问题
因此,人们在使用 CSS 为 IE6 和所有其他浏览器编程和实现 HTML 模板时很少遇到麻烦。但这一次让我很头疼。
问题是 IE6 的兼容性(我正在使用 YAML 框架)。
所以,让我们继续吧。这是罪魁祸首代码:
HTML
<div class="info">
<div>
<div class="float_left">
<img alt="aktuelles bild" src="images/dummy_aktuelles.gif" />
<span>26.10 - 27.10.2010</span>
<span>xxx xxx</span>
<span>(Flughafen)</span>
</div>
<div class="lastObject">
<span>09.09.2010 Offenes-Presseportal</span>
<span class="lastObject">Global Connect 2010 - Globalisierung für den Mittelsand</span>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam leo.
</p>
</div>
</div>
</div>
CSS
#main .aktuelles .info {
padding:15px;
overflow:hidden;
border-bottom: 1px #949494 dotted;
}
#main .aktuelles .info .float_left {
width:35%;
}
#main .aktuelles .info .float_left span {
padding-bottom: 5px;
display: block;
color: #333;
font-size: 13px;
}
#main .aktuelles .info .float_left img {
padding-bottom: 5px;
}
#main .aktuelles .info div .lastObject span {
color:#2d2d2d;
font-size: 12px;
display: block;
padding-bottom: 5px;
}
#main .aktuelles .info div.lastObject span.lastObject {
color: #2d2d2d;
font-size: 14px;
display:block;
padding: 0 0 5px 0 !important;
}
#main .aktuelles .info div lastObject p {
font-size: 12px;
}
现在第一个向左浮动的 div 根本不出现。它位于lastObject 的背景之下。 info div 的父容器没有任何位置。
有什么建议吗?
这是错误的图像:
看来问题与此代码无关。但我没有任何其他想法。我还尝试更改 z 索引,但它显然不起作用,因为它不是背景图像,而是背景颜色。
So people I seldom have trouble programming and implementing HTML templates with CSS for IE6 and all the other browsers. But this time this is breaking my head.
The issue is compatibility for IE6 (I'm using the YAML framework.)
So, lets get on with it. This is the culprit code:
HTML
<div class="info">
<div>
<div class="float_left">
<img alt="aktuelles bild" src="images/dummy_aktuelles.gif" />
<span>26.10 - 27.10.2010</span>
<span>xxx xxx</span>
<span>(Flughafen)</span>
</div>
<div class="lastObject">
<span>09.09.2010 Offenes-Presseportal</span>
<span class="lastObject">Global Connect 2010 - Globalisierung für den Mittelsand</span>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam leo.
</p>
</div>
</div>
</div>
CSS
#main .aktuelles .info {
padding:15px;
overflow:hidden;
border-bottom: 1px #949494 dotted;
}
#main .aktuelles .info .float_left {
width:35%;
}
#main .aktuelles .info .float_left span {
padding-bottom: 5px;
display: block;
color: #333;
font-size: 13px;
}
#main .aktuelles .info .float_left img {
padding-bottom: 5px;
}
#main .aktuelles .info div .lastObject span {
color:#2d2d2d;
font-size: 12px;
display: block;
padding-bottom: 5px;
}
#main .aktuelles .info div.lastObject span.lastObject {
color: #2d2d2d;
font-size: 14px;
display:block;
padding: 0 0 5px 0 !important;
}
#main .aktuelles .info div lastObject p {
font-size: 12px;
}
Now the first div that is floating to the left doesn't appear at all. It is underlying the background of lastObject. The parent container of the info div has no position whatsoever.
Any suggestions?
This is an image of what is wrong:
It seems the problem is not related to this code. but I dont have any other ideas. I also tried altering the z index but it evidently wont work since its not a background image it is the background color.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据评论,这似乎是一个典型的 hasLayout (消失的内容版本)错误,
添加:
position:relative;
到左侧浮动 div.float_left
as per comments, it appears to be a typical hasLayout (disappearing content version) bug,
add:
position: relative;
to the left floated div.float_left
附上我所看到的 IE6 fiddle 页面的屏幕截图,供您参考:
Attached a screenshot of the IE6 fiddle page as I can see it, for your reference: