请帮助我。我需要使用百分比宽度创建布局。我有一个 100% 宽度的包装纸。
现在我有一个 DIV(主包装器..我想保持 94% 的宽度百分比.. 94% 的 100% 身体).. 好的
所以让这个简单。
-> BODY 100% 宽度设置
--> 容器 94% 宽度
---> FIRST CHILD DIV 70% 向左浮动(容器的 70%)
---> SECOND CHILD DIV 30% 向右浮动(容器的 30%)
但我在 FIRST CHILD DIV 下有 2 个相等的列
-----> 50% 和 50% 百分比宽度
错误是:在 ie7 中..最后一列显示在底部..它没有正确浮动..如果我将宽度减小到 29.9% !!! 它有效..我认为ie7在处理百分比宽度或其他方面存在错误..请澄清这一点。我希望您能解决问题,因为 css / html 太长了.. 我只是希望这是一个常见问题.. :(
这是这个 DIV 的 CSS .. 希望有帮助:)
body {
width: 100%;
background: #fff;
text-align: center;
font-size: 12px;
}
#wide-primary {
background: #fff url(img/shadow1.png) repeat-x top;
position: relative;
top: -1px;
}
#primary {
width: 94%;
margin: 0 auto 0 auto;
text-align: left;
}
#features {
float: left;
width: 70%;
padding: 2% 0 0 0;
}
.featurebox {
float: left;
width: 48%;
padding: 0 2% 3% 0;
}
#lastnews {
float: right;
width: 30%;
padding: 2% 0 2% 0;
}