对于我的生活,我不能弄明白这一点。
如何让2列在页脚中浮动:
<footer>
<div id="footerWrap">
<div id="footerLeft">
left col
</div>
<div id="footerRight">
right col
</div>
</div>
</footer>和我的CSS:
footer {
background: url("../images/50x50white-bg.png") repeat scroll 0 0 transparent;
clear: both;
}
#footerWrap {
margin: 0 auto;
padding: 20px;
width: 960px;
}
#footerLeft {
border-right: 1px solid #000000;
width: 349px;
float:left;
}
#footerRight {
border-right: 1px solid #000000;
width: 609px;
float:left;
}发布于 2011-09-02 06:19:17
你可能遇到了一个问题,因为#footerLeft和#footerRight太宽了。包装器是960px,两边都有20px的填充,只剩下920px。两个脚注元素的宽度之和为960。您需要删除#footerWrap上的水平填充,或者将每个页脚元素的宽度减少20。
/* Then simply: */
#footerRight, #footerLeft {
float: left;
}
/* and potentially a simple clearfix: */
#footerWrap {
overflow: hidden;
}https://stackoverflow.com/questions/7277171
复制相似问题