我有一个2列布局,我早些时候(Simple 2 column layout)。 我注意到的是,问题不在于右侧内容列的定位,而是该列中内容的定位方式。
我一直在寻找一段时间,我看不出问题出在哪里。看起来右列中的内容在其上的填充等于左列的高度。
这是我的css:
#wrapper { margin-left: 100px; width: 1000px; border-left: 1px solid #bcbcc6; border-right: 1px solid #bcbcc6; border-bottom: 1px solid #bcbcc6; }
/* Main page content, puts actual content and sidebar side-by-side */
#sidebar { float: left; padding: 5px; width: 189px; border-right: 1px solid #b6bcc6; }
#content { padding: 0 !important; margin: 0 0 0 200px; width: 790px; background-color: #ff00ff; }
编辑:要查看实际情况,您可以查看http://www.logansarchive.za.net/bad.jpg和http://www.logansarchive.za.net/firebug.jpg 我也将添加页面和样式相关的文件(样式表和图像),以便您可以随意检查: http://www.logansarchive.za.net/Default.aspx
答案 0 :(得分:1)
“使用Firebug”通常不被视为对SO的有效答案,但它确实是识别神秘填充的最佳方式。将其安装在Firefox中,右键单击该元素,Firebug的布局视图将显示它的来源。
答案 1 :(得分:1)
在<div id="content">
内,你的CSS中有一个clear: both
的表,然后分别有clear: left
和clear: right
的2个div,它们会破坏你的花车。删除Firebug中的所有这些明确属性会在测试页面上为我修复它。
答案 2 :(得分:0)
您是否尝试过制作#content float:right