页面停止滚动

时间:2013-03-28 08:29:53

标签: html css

我不明白发生了什么但突然我的页面没有向下滚动以查看剩下的内容......

检查出来:www.guestinnation.com/hotels.html

正如您所看到的那样,使用inspect元素功能,div比它看起来要长得多......

在此之前我已经为页面的60%的div设置了一个高度并使用了溢出:滚动,但后来我决定我只是希望它像主页一样,所以我取消了{{ 1}}和溢出:滚动,但结果就像你看到的那样......

提前谢谢!

3 个答案:

答案 0 :(得分:2)

<强>被修改

改变你的css上的两个位置:

#main{
  position: relative; // change it from fixed
}
#menumain2 {
  position: absolute; // change it from fixed
}
#menumain {
  position: absolute; // change it from fixed
}

答案 1 :(得分:1)

这样做:

#main
{
   position: relative;
}
#menumain
{
   position: absolute; 
}
#menumain2 
{
   position: absolute;
}

答案 2 :(得分:1)

您的页面滚动已消失,因为您使用position: fixed;来固定主要内容。这意味着元素相对于浏览器窗口定位。

尝试使用类似的东西进行模拟。

<body>
      <div id="wrapper">
            <header></header>
            <div id="main"></div>
            <footer></footer>
      </div>
</body>

.wrapper{
      margin: 0 auto;
      position: relative /* Just in case */
      width: 960px; }

我就是这样开始的。

或者,如果您在启动网站时遇到问题,请尝试使用一些HTML入门包,网络上就会充满它们。