Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap row with horizontal scroll

Im trying to get a row with multiple columns (dynamic with no max) and therefore to get an horizontal scroll.

When i insert a new column that exceeds the size 12 of bootstrap, it takes that column to a new line. What I want is to preserve that column in the same line and to get the horizontal scroll view.

Tried already with something like this, but didn't worked...

<div class="span11" style="overflow: auto">
    <div class="row-fluid">
        <div class="col-lg-3">COL1</div>
        <div class="col-lg-3">COL1</div>
        <div class="col-lg-3">COL1</div>
        <div class="col-lg-3">COL1</div>
        <div class="col-lg-3">COL1</div>
        <div class="col-lg-3">COL1</div>
        <div class="col-lg-3">COL1</div>
    </div>
</div>
like image 886
Nacho Avatar asked Oct 09 '14 14:10

Nacho


2 Answers

row-fluid need the style attribute " white-space: nowrap; " and the divs inside need the style attribute " display: inline-block; "

.row-fluid{
     white-space: nowrap;
}
.row-fluid .col-lg-3{
     display: inline-block;
}

try it

like image 154
Erfan Nazmehr Avatar answered Oct 18 '22 15:10

Erfan Nazmehr


Larger screen will also need float: none; in col- classes.

.row-fluid {
    overflow: auto;
    white-space: nowrap;
}

.row-fluid .col-lg-3 {
     display: inline-block;
     float: none;
}
like image 23
FaizFizy Avatar answered Oct 18 '22 14:10

FaizFizy