gpt4 book ai didi

html - float div 重叠 msie

转载 作者:行者123 更新时间:2023-11-28 14:56:47 24 4
gpt4 key购买 nike

我一直在思考为什么 MSIE8 不像 webkit 和 mozilla 那样与 float div 重叠。我希望你们能帮我解决这个问题。

我有以下代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="style" href="style.css" type="text/css" />
</head>
<body style="margin: 0px; background: #3b0404;">
<div align="center">
<div id="top" style="height: 100px; background: yellow; width: 100%;max-height: 100px; ">
<div style="overflow: visible; width: 800px; height: 100px; max-height: 100px; background: aquamarine;">
<div id="logo" style="float: left; margin-left: -3px; width: 203px; height: 201px; background: pink; overflow: visible;"></div>
<div id="menu" style="float: right; width: 595px; height: 100px; background: blue;"></div>
</div>
</div>
<div id="content" style="width: 800px; margin-left: auto; margin-right: auto;">
<div style="background: purple; height: 215px;"></div>
<div style="background: green; height: 350px;"></div>
</div>
<div id="bottom"></div>
</div>
</body>
</html>

我需要粉色 div 在保持尺寸的同时与紫色 div 重叠,但是 MSIE8 不断扩展包含的 div,因此它会将所有内容向下推,而不是预期的行为。

我希望我的问题很清楚,我不知道我是否做错了什么,应该采取不同的方法。

感谢您的帮助!

最佳答案

这是过渡性 DOCTYPE .. 它在 JSFiddle 上看起来不错,因为它添加了严格的 dtd。

感谢大家的宝贵时间。

关于html - float div 重叠 msie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3517954/

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