Css div未正确对齐
我有一些相当简单的CSS代码,似乎不工作的权利Css div未正确对齐,css,html,xhtml,alignment,Css,Html,Xhtml,Alignment,我有一些相当简单的CSS代码,似乎不工作的权利 html, body { border:0; margin:0; padding:0; } body { font:12px Arial, Helvetica, sans-serif; background: url(../img/bg-tile.png) repeat; color: #444} .content{ background-color:#CCDDEE; width:100%; margin: 0px aut
html, body { border:0; margin:0; padding:0; }
body { font:12px Arial, Helvetica, sans-serif; background: url(../img/bg-tile.png) repeat; color: #444}
.content{
background-color:#CCDDEE;
width:100%;
margin: 0px auto;
}
.column{
padding:0% 2% 0% 0%;
width:29%;
float:left;
height:auto;
}
.myText{
padding:0px 25% 0px 0px;
font-size:16px;
}
.footer{
margin-bottom:2%;
padding:0px;
position: absolute;
}
.wrapper {
width:75%;
height:auto;
margin:1% auto;
}
我的html如下所示:
<body>
<div class="wrapper">
<img src="img/logo2.jpg" alt="" />
<!--Snipped some code Just a nav -->
<br /><br />
<div class="content">
<img src="img/slider6.jpg" alt="" /><br /><br />
<div class="column">
<p class="myText">
Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text,
</p>
</div>
<div class="column">
<p class="myText">
Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text,
</p>
</div>
<div class="column">
<p class="myText">
Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text,
</p>
</div>
</div>
<br />
</div>
<div class="footer">
©2013 blahblahblah® | Terms of Use | Privacy Policy | Press Inquiries
</div>
</body>
</html>
测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,
测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,
测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,
&抄袭;2013 blahblahblah®;|使用条款|隐私政策|新闻查询
我遇到的问题是,我的脚像这样坐在我的“柱子”上(图片输入)
添加
溢出:隐藏编码>到.content
将使.content
正确包含浮动元素。这也将使背景色适用于浮动列
如果不希望.content
包含浮动元素,请添加溢出:隐藏代码>改为.wrapper
您看到的问题是由于列上的浮动。CSS float将元素从正常流中移除,因此在渲染时,包含元素的高度不会考虑浮动元素的高度
因此,页脚将在内容之后呈现(正确),但.content
的高度不正确
另一种方法是清除
浮动内容-请参阅和