将div放置在另一个div的底部 [英] position div at the bottom of another div

查看:59
本文介绍了将div放置在另一个div的底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的div嵌套在另一个

I have a div nested inside another

<div id="wrapper">
  <div id="left"></div>
  <div id="right"></div>
  <div id="footer"></div>
</div>

CSS是

#wrapper{
width:800px;
}
 #left{
 float:left;
 width: 200px;
 }
#right{
  float: left;
  width: 600px;
}
#footer{
  width:800px;
  height: 20px; 
}

我如何确保页脚停留在包装div的底部?

How can i ensure that the footer stays at the bottom of the wrapper div?

推荐答案

http://jsfiddle.net/LMeZ9/

只需使用clear:both

just use clear:both

#footer{
  width:800px;
  height: 20px;
  clear:both
}

这篇关于将div放置在另一个div的底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆