3列布局 auto问题
时间:2011-07-22
来源:互联网
大家好 问个问题如下:
比如我有个页面:
<div style="margin-left:auto;margin-right:auto;width:900px;height:auto;">
<div style="float:left;width:300px;background-color:red;height:auto;">
ccccc<br/><br/><br/><br/><br/><br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:blue;height:auto;">
bbbb<br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:green;height:auto;">
aaaa<br/><br/><br/>
</div>
</div>
<div id="footer" style="height:100px;background-color:pink;">
</div>
我想实现的效果是中间3列布局 footer 显示在页面底下 可是以上代码footer显示在页面顶部 感到不解 请大侠指教!
比如我有个页面:
<div style="margin-left:auto;margin-right:auto;width:900px;height:auto;">
<div style="float:left;width:300px;background-color:red;height:auto;">
ccccc<br/><br/><br/><br/><br/><br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:blue;height:auto;">
bbbb<br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:green;height:auto;">
aaaa<br/><br/><br/>
</div>
</div>
<div id="footer" style="height:100px;background-color:pink;">
</div>
我想实现的效果是中间3列布局 footer 显示在页面底下 可是以上代码footer显示在页面顶部 感到不解 请大侠指教!
作者: Brokenfango 发布时间: 2011-07-22
<div style="margin-left:auto;margin-right:auto;width:900px;height:auto;">
<div style="float:left;width:300px;background-color:red;height:auto;">
ccccc<br/><br/><br/><br/><br/><br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:blue;height:auto;">
bbbb<br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:green;height:auto;">
aaaa<br/><br/><br/>
</div>
</div>
<div style="clear:both;"></div>
<div id="footer" style="height:100px;background-color:pink;">
</div>
<div style="float:left;width:300px;background-color:red;height:auto;">
ccccc<br/><br/><br/><br/><br/><br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:blue;height:auto;">
bbbb<br/><br/><br/>
</div>
<div style="float:left;width:300px;background-color:green;height:auto;">
aaaa<br/><br/><br/>
</div>
</div>
<div style="clear:both;"></div>
<div id="footer" style="height:100px;background-color:pink;">
</div>
作者: hongmei85 发布时间: 2011-07-23
footer清除一下浮动就行了。
作者: Acesidonu 发布时间: 2011-07-23
需要在footer层前面清除浮动:
......
<div style="clear:both"></div>
<div id="footer" style="height:100px;background-color:pink;">
......
<div style="clear:both"></div>
<div id="footer" style="height:100px;background-color:pink;">
作者: dalmeeme 发布时间: 2011-07-23
没错 谢谢各位!
作者: Brokenfango 发布时间: 2011-07-23
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28