Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap: How to enable scroll bars?

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 screen, but not in my case. I searched in bootstrap css file after overflow: hidden; or something like that and deleted it, but that didn't solve the problem.

Does someone know how to enable scrollbar in bootstrap css? (without bootstrap css the bars are showed)

edit:

I have find out that the problem the navbar-fixed in the black navbar which you can add. Without postition: fixed it works fine.

like image 368
loon3x Avatar asked Apr 25 '12 17:04

loon3x


People also ask

How do I scroll in bootstrap?

Add data-spy="scroll" to the element that should be used as the scrollable area (often this is the <body> element). Then add the data-target attribute with a value of the id or the class name of the navigation bar ( . navbar ). This is to make sure that the navbar is connected with the scrollable area.

How do I make a scrollable column in bootstrap?

All you have to do is force the height of the containing div (here a row) to the height of the viewport. Then you make all the columns 100% height and set the overflow-y to scroll. That way any overflow on the column will be scrollable, but they will still take up the whole page.


2 Answers

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.

like image 89
loopasam Avatar answered Sep 19 '22 14:09

loopasam


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

like image 44
Michael Christie Avatar answered Sep 19 '22 14:09

Michael Christie