-3

我不明白发生了什么,但突然我的页面无法向下滚动以查看其余内容...

看看:www.guestinnation.com/hotels.html

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

在此之前,我为页面的 div 设置了一个高度60%并使用了溢出:滚动,但后来我决定我只是希望它像主页一样,所以我取消了height=60%和溢出:滚动,但它最终是如你所见...

先感谢您!

4

3 回答 3

2

已编辑

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

#main{
  position: relative; // change it from fixed
}
#menumain2 {
  position: absolute; // change it from fixed
}
#menumain {
  position: absolute; // change it from fixed
}
于 2013-03-28T08:40:26.953 回答
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 入门包,网络上到处都是。

于 2013-03-28T08:46:57.367 回答
1

做这个 :

#main
{
   position: relative;
}
#menumain
{
   position: absolute; 
}
#menumain2 
{
   position: absolute;
}
于 2013-03-28T08:43:43.043 回答