日期:2014-05-17 浏览次数:20864 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>谢谢解答</title> <style> .container{width:98%;} .rightcontent{margin:5px 0 0 180px; background-color:#ececec;} .leftcontent{position: absolute; left: 10px; width: 170px; color: #564b47; margin: 0px; padding: 0px; overflow:auto; height:100%; } </style> </head> <body> <div class="container">这是头部</div> <div class="container"> <div class="rightcontent">内容的右边</div> <div class="leftcontent"> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> <div>左边的推荐列表</div> </div> </div> <div class="container">这里是底部,看不到啊啊啊啊啊啊啊啊啊</div> </body> </html>
.leftcontent{position: absolute; left: 10px; width: 170px; color: #564b47; margin: 0px; padding: 0px; overflow:auto; height:auto; }
------解决方案--------------------
把.leftcontent中的positon属性值改成:relative;
改后如下:
.leftcontent{
position: relative;
left: 10px;
width: 170px;
color: #564b47;
margin: 0px;
padding: 0px;
overflow:auto;
height:100%;
}