你必须使用绝对位置和底部 0,就像上面说的Sarfraz一样。
这是示例代码:
<html>
<head>
<style>
body { width:100%;}
.box { float: left; height: 200px; margin-right: 5%; position: relative; width: 20%;}
.footer {bottom: 0px; position: absolute; width: 100%; text-align: center;}
.box_content{ height: 180px; overflow-y: scroll;}
.clear { clear:both;}
</style>
</head>
<body>
<div class="box">
<div class="box_content">
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
</div>
<div class="footer">Footer</div>
</div>
<div class="box">
<div class="box_content">
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
</div>
<div class="footer">Footer</div>
</div>
<div class="box">
<div class="box_content">
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
Content goes here <br />
</div>
<div class="footer">Footer</div>
</div>
<div class="clear"> </div>
</body>
</html>