出于某种原因,即使我的内容扩展到页面下方,并且溢出CSS,我也无法向下滚动页面。出现滚动条,但我无法向下滚动。如果您需要页面上的代码多于我提供的代码,请告诉我们!
在窗口下方扩展的内容的HTML:
<div id="images">
<p>Here you will find some of my Photoshops!</p>
<img style = "top:50%;left:50%;margin-left:-350px;" src="lufthansa747-8.jpg" width="720" height="460">
<img style = "top:100%;left:50%;margin-left:-350px;" src="advert.jpg" width="720" height="460">
可能影响该区域的区域代码的CSS:
#images p{
position: fixed;
top: 40%;
left: 50%;
margin-left: -125px;
color: #1D60E2;
text-align: center;
}
#images img{
position: fixed;
}
body {
background-color: #C2DFFF;
min-height: 200px;
overflow: scroll;
}
答案 0 :(得分:3)
我认为这是因为您使用position: fixed
属性。如果你想滚动查看所有内容,我想你应该删除它或用绝对定位替换它。
#images p{
position: absolute;
top: 40%;
left: 50%;
margin-left: -125px;
color: #1D60E2;
text-align: center;
}
#images img{
position: absolute;
}
body {
background-color: #C2DFFF;
min-height: 200px;
overflow: scroll;
}
真正的问题是:你想要达到什么目的?因为在大多数情况下,您当前的CSS不会成为解决方案:)