标题与内容重叠

发布于 2024-07-23 11:38:29 字数 422 浏览 2 评论 0原文

我在相对定位的元素(主体内容)之后放置了绝对定位的元素(标题)。 由于某种原因,除了 IE8 之外,这在所有浏览器中都可以正常工作。 标头与内容元素重叠,但未定位在其绝对位置。 我使用的CSS规则:

#bodyContent{
    clear: both;
    display: table;
    width: 920px;
    margin-top: 173px;
    _margin-top: 178px;
    position: relative;
}
#headerContainer {
    position: absolute;
    top: 0px;
    left:0px;
}

标题部分从内容元素位置渲染,其位置有空格。

这是IE8的bug吗? 谁能帮我解决这个问题吗?

I have placed an absolutely positioned element (header) after relatively positioned element (body content). Due to some reason and this works fine in all the browsers except IE8.
The header is overlapping the content element with not positioned at its absolute position.
The css rules I have used:

#bodyContent{
    clear: both;
    display: table;
    width: 920px;
    margin-top: 173px;
    _margin-top: 178px;
    position: relative;
}
#headerContainer {
    position: absolute;
    top: 0px;
    left:0px;
}

The header part is rendering from the content element postition with space in its position.

Is this the bug in IE8? Can anyone help me sort out this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不打扰别人 2024-07-30 11:38:29

这听起来像是一个古老的 IE7 bug..你能在它们之间放置一个元素吗? 这为我解决了。

This sounds like an old IE7 bug.. can you place an element between them? That fixed it for me.

沧笙踏歌 2024-07-30 11:38:29

我也遇到过类似的问题。 我使用了 float 命令解决了这个问题。 尝试float: left; 在#headerContainer 中

I've also had similar problems. I used the float command which solved the issue. Try float: left; in #headerContainer

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文