【问题标题】:double scrollbar but no scrolling双滚动条但没有滚动
【发布时间】:2012-02-16 08:20:07
【问题描述】:

我有以下 css 和 html,它会导致 firefox(尚未检查其他浏览器)显示两个滚动条(右侧 2 个和底部 2 个),但它们似乎被禁用,因为即使最小化它不滚动的页面也是如此

    * {
    font-family:'Helvetica Neue','Helvetica','Arial';
    font-size:12px;
    color:#333;
}

html, body {
    background:#e0e0e0;
    height:100%;
    background-image: url('/images_/backgrounds/background.jpg');
    background-repeat: repeat-x;    
    margin:0;
    overflow: scroll;
}

/***************** main wrapper and content ********************/

#wrapper {
    text-align: left;
    margin: 0px auto;
    /*padding: 0px 12px 0px 12px;*/
    border:0;
    width: 960px;
    height: 100%;
    background-image: url('/images_/backgrounds/content_shadow.png');
    background-repeat: repeat-y;
}

#content { 
    float: left;
    width: 100%;
    padding:85px 16px 10px 18px;
}

#topbar {
    width:100%;
    height:42px;
    margin:0;
    padding:0;
    background: #0066cc;
    /* make top bar stick to the top of browser */
    position:fixed;
    z-index:800;
    /*Making sure it sticks to left of window in IE7*/
    top:0;
    left:0;
    float:left;
    -webkit-box-shadow: 0 8px 6px -6px #666;
    -moz-box-shadow: 0 8px 6px -6px #666;
    box-shadow: 0 8px 6px -6px #666;
}

#top_blur {
    width:940px;
    margin:0 auto;
    height:70px;
    z-index:1;
    /*background-color: red;
    background-repeat: no-repeat;*/
    position:fixed;
}

.header {
    width:940px;
    margin:0 auto;
    position: fixed;
    /*top: -70px;*/
    z-index: 801;
}

这是html

<body><div id="wrapper">
<div id="topbar"></div>
<div id="top_blur"><img src=/images_/backgrounds/top_blur.png></div>
<div class="header"> header content here</div></div>

溢出:滚动;

是否有强制滚动条来修复移动页面错误,当滚动条打开与关闭时,brosers 必须停止整个页面移动 - 我尝试将其设置为自动但在最小化时仍然没有滚动条

【问题讨论】:

    标签: html css


    【解决方案1】:

    这里的重要部分是因为您的 DIVS 中的那些 FIXED Positions。这就是您的滚动无效的原因。

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      使用:

      overflow: scroll;
      

      即使不需要,您也会强制使用滚动条。 试试看:

      overflow: auto;
      

      仅在需要时显示栏。

      【讨论】:

      • 我试过了,滚动条确实消失了,但即使最小化了,仍然没有滚动 - 将更新问题,因为忘记提及了,非常感谢
      【解决方案3】:

      Aaarrrgh - 我错过了 "&lt;/div&gt;" @philip badilla 提示重新计票!

      【讨论】:

        猜你喜欢
        • 2011-08-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-11-17
        • 1970-01-01
        • 2010-11-22
        • 2013-02-25
        相关资源
        最近更新 更多