Bootstrap: How to enable scroll bars?

前端 未结 5 1153
耶瑟儿~
耶瑟儿~ 2021-02-19 03:39

I use Twitter Bootstrap in one of my projects, but I have the problem that my content goes out of the browser view. Normally you see the scrollbar on the right side of the scree

相关标签:
5条回答
  • 2021-02-19 04:28

    Override it with your last stylesheet.
    ( Probably your own theme stylesheet. )

    html, body {
        overflow: visible;
    }
    
    0 讨论(0)
  • 2021-02-19 04:28
    <style type="text/css">
                body, html {
                    height: 100%;
                    overflow: hidden;
                }
    
                .navbar-inner {
                    height: 40px;
                }
    
                .scrollable {
                    height: 100%;
                    overflow: auto;
                }
    
                .max-height {
                    height: 100%;
                }
    
                .no-overflow {
                    overflow: hidden;
                }
    
                .pad40-top {
                    padding-top: 40px;
                }
        </style>
    

    Hope this is what you are looking for

    0 讨论(0)
  • 2021-02-19 04:31

    Make sure all the <div> from the navbar are closed. If not, the fixed property is inherited by the descending tags and the scroll bars disappears.

    0 讨论(0)
  • 2021-02-19 04:33

    I found removing the "position: fixed" for the navbar resolved this problem for me:

    .navbar-fixed-top, .navbar-fixed-bottom {
        /*position: fixed;*/
        right: 0;
        left: 0;
        z-index: 1030;
        margin-bottom: 0;
    }
    

    This guy also has some more useful info: http://davidlains.com/strange-twitter-bootstrap-scrolling-issue

    0 讨论(0)
  • 2021-02-19 04:40

    You are missing a closing </div> in your HTML code. For every <div class="foobar"> you must have a closing </div>. This (scrolling issue) can happen when using twitter bootstrap and not closing your divs.

    0 讨论(0)
提交回复
热议问题