(注意,这不是双重保证金的错误,我现在称这是双垂直填充的bug,除非其他人有更聪明的/记录的名称)什么是这个IE浏览器的CSS错误称为? (双垂直填充)
就在我以为我看过所有古怪的IE浏览器的CSS错误时,我制作了一个简单的测试用例,它继续让我感到困惑。下面的页面看起来很棒,在FF,Opera等人中效果很好。但是,IE 6和IE 7似乎感到困惑。我会让我粘贴的文件为自己说话。
编辑:我已经把这个在以下网址:http://jsbin.com/efele
打开它在IE浏览器,并再次在FF。比较。
我的问题是:这个bug叫什么? (我是否错过了这个地方?它是否在this page?上找到?)我熟悉3px慢跑错误和双(水平)-margin错误以及很多其他与浮动相关的错误。但是......垂直填充正在重复? (并放在错误的地方,开机。)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IE bork!</title>
<style type="text/css">
html, body {
margin:0;
padding:0;
}
#container {
border:1px solid red;
background-color:#CC99CC;
width:800px;
margin:0 auto;
padding-top:100px;
}
#sidebar {
float:left;
display:inline;
width:200px;
border:1px solid blue;
background-color:#00CCFF;
}
#content {
float:right;
display:inline;
width:510px;
border:1px solid green;
background-color:#66CC99;
}
.clear {
clear:both;
/* height:0px; <<< setting height seems to be the only thing that makes this work as expected?!? */
background-color:#CCCCCC; /* bg color here is just for debugging */
}
</style>
</head>
<body>
<div id="container">
<div id="sidebar">I am the sidebar</div>
<div id="content">I am the content</div>
<div class="clear"><!-- clear! --></div>
</div>
<p>There should be 100px of space above the two floats, but <em>no</em> space below them...</p>
</body>
</html>
P.S.,我终于弄清楚如何安抚IE浏览器了。解决方案(明确地在我的“清除”div上设置高度)被注释掉以显示错误。我只希望我能回到生命中的最后几个小时,这让我偶然发现真正的问题/解决方案!
谢谢!
我希望有一个有趣/聪明的名字,例如那些在你链接的网站上;我想我得解决一些无聊的事情! – Funka 2009-12-08 23:31:02