两个重叠的部门,但上面的部分是不可滚动的

时间:2012-12-16 17:01:05

标签: css

我的html页面中有两个分区,分别是css

<html>
<head>
#lowerone
{position:absolute; bottom:25px; right:25px; height:300px; width:300px;}
#upperone
{position:absolute; bottom:25px; right:25px; height:300px; width:300px; overflow:scroll;}
</head>
<body>
<div id="lowerone">
</div>
<div id="upperone">
<img src="/bg.3.jpg" />
</div>
</body>
</html>

但是上层div,即UPPERONE是uncrollabe .. 如何使其可滚动?

2 个答案:

答案 0 :(得分:1)

使用2个绝对定位div的任何特定原因相互重叠?而且<style>个标签丢失了...而滚动对我来说很有用..

Demo

答案 1 :(得分:0)

检查下面的代码,两个滚动工作,

<html>
<head>
    <style>
#lowerone
{position:absolute; bottom:25px; right:25px; height:250px; width:300px;overflow:scroll;}
#upperone
{position:absolute; bottom:25px; left:25px; height:250px; width:300px; overflow:scroll;}
    </style>
</head>
<body>
<div id="lowerone">
    <img src="http://media.caranddriver.com/images/12q4/477956/2014-gmc-sierra-1500-photos-and-info-news-car-and-driver-photo-492039-s-450x274-1.jpg" />
</div>
<div id="upperone">
<img src="http://media.caranddriver.com/images/12q4/477956/2014-gmc-sierra-1500-photos-and-info-news-car-and-driver-photo-492039-s-450x274-1.jpg" />
</div>
</body>
</html>

这是我的FIDDLE