【发布时间】:2012-06-27 16:00:45
【问题描述】:
我正在设置一个非常简单的固定液体布局。 header 设置为 100%,sidebar 设置为固定宽度并向左浮动,内容区域的宽度没有定义(这样就填满了剩余空间)。
它适用于除 IE 之外的所有浏览器,其中在侧边栏和内容区域之间添加了大约 3 像素的空白。
我无法在 JSFiddle 中重现该问题(即使我复制并粘贴了我的确切代码),因此我附上了图片。第一张图片在 Chrome 中渲染,第二张在 IE9 中渲染。
CSS (styles.css)
body {
margin: 0px;
}
#header {
width: 100%;
height: 150px;
background: #F00;
}
#sidebar {
float: left;
width: 280px;
height: 1000px;
background: #0F0;
}
#content {
height: 1000px;
background: #00F;
}
HTML
<html>
<head>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="header"></div>
<div id="sidebar"></div>
<div id="content"></div>
</body>
【问题讨论】:
-
你在哪个版本的 IE 上运行它?
-
版本:9.0.8112.16421;更新版本:9.0.7(不确定是什么意思)
标签: html css internet-explorer fixed liquid-layout