bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Grid seems to create a horizontal scroll bar

Open lters opened this issue 13 years ago • 38 comments

This seems to be creating a horizontal scroll bar...

div class='col-sm-3 col-md-2 col-lg-2'> div class='col-sm-6 col-md-8 col-lg-8'> div class='col-sm-3 col-md-2 col-lg-2'>

Not sure how to display the sample divs...

scroll

lters avatar Aug 19 '13 17:08 lters

Pull the latest—it's been fixed.

mdo avatar Aug 19 '13 17:08 mdo

I am still getting the scroll bar, running live 3.0?

lters avatar Aug 21 '13 13:08 lters

@lters I think that your col-sm- classes add up to 13 columns, when the grid only has 12 columns. Try making either the first or the last div have col-sm-2

jamescostian avatar Aug 21 '13 15:08 jamescostian

10 //Main Pane CSS 11 $leftpane="hidden-xs hidden-sm col-md-2 col-lg-2"; 12 $midpane="col-xs-8 col-sm-8 col-md-7 col-lg-7"; 13 $rightpane="col-xs-4 col-sm-4 col-md-3 col-lg-3";

This is how I have it now.

Shall I change it? It still has the little scroll bar, no matter what I do.

lters avatar Aug 22 '13 12:08 lters

The code you wrote above should work.

jamescostian avatar Aug 22 '13 19:08 jamescostian

This still seems to be an issue (using the latest) - http://bootply.com/76369

iatek avatar Aug 23 '13 09:08 iatek

for create grid with full page width with this html, yes it has horizontal scrollbar.

for anyone who can't re-produce just create full page grid layout (full page fluid like it was in bootstrap 2) and you can see horizontal scrollbar.

download latest bootstrap today but nothing was fixed. "mdo" you should not close this issue.

ve3 avatar Aug 23 '13 18:08 ve3

Full-width stuff is currently covered by #9998.

cvrebert avatar Aug 23 '13 18:08 cvrebert

@iatek your code is missing a div with a container class. When you add that class, everything works fine: http://bootply.com/76643

jamescostian avatar Aug 23 '13 18:08 jamescostian

But if I add a div with a container class first, than the outside margins are too big, huge, like half an inch depending on the screen width.

That is worse the the scroll bar :(.

lters avatar Aug 26 '13 13:08 lters

This happens because row has margin-left: -15px and margin-right:-15px; with the old container-fluid it worked because the browser will only measure only the container-fluid... but now it is incorrect and 'should' have scroll bars. :( I think you are going to have to add container-fluid back in guys

nimeso avatar Aug 26 '13 19:08 nimeso

Still appear scroll, code:

 <div class="row">
        <div class="col-md-12">
        </div>
        <div class="row">
            <div class="col-md-3">
            </div>
            <div class="col-md-6">
            </div>
            <div class="col-md-3">
            </div>
        </div>
  </div>

wangel13 avatar Aug 28 '13 09:08 wangel13

i think Bootstrap should give us back the "container-fluid".

for anyone who has problem with fluid width have horizontal scroll bar, please use this html

<div class="container-fluid">
    <div class="row">
        <div class="col-md-4">column 1</div>
        <div class="col-md-4">column 2</div>
        <div class="col-md-4">column 3</div>
    </div>
</div>

and this custom css

.container-fluid {
    padding: 0 15px;
}

this container-fluid will add padding left and right 15px each that can prevent create horizontal scrollbar.

again. bootstrap 3, please give us back the "container-fluid"

ve3 avatar Aug 28 '13 10:08 ve3

Surely BootStrap will fix this a 'right' way...

lters avatar Aug 28 '13 12:08 lters

why not simply override .row class like this

.row {
  margin-left: 0px;
  margin-right: 0px;
}

wannymiarelli avatar Aug 28 '13 17:08 wannymiarelli

.row {
  margin-left: 0px;
  margin-right: 0px;
}

I think this is dirty hack

wangel13 avatar Aug 28 '13 18:08 wangel13

is only temporary, it is true that it is not fabulous, but it's better than rebuilding the container-fluid. The ones that are here are all temporary solutions, so I think it's better to adopt the simplest (which does not change the markup) so that you can simply switch to working version when released.

Unless Bootstrap want to re-enter the fluid container class.

wannymiarelli avatar Aug 28 '13 18:08 wannymiarelli

@wannymiarelli great move for now. thanks.

kevonc avatar Aug 29 '13 20:08 kevonc

Hi,

Today i've seen Bootstrap released new version 3.0.1. But the fix for full width layout is

Folks looking to create fully fluid layouts (meaning your site stretches the entire width of the viewport) must wrap their grid content in a containing element with padding: 0 15px; to offset the margin: 0 -15px; used on .rows.

I wondered why don't you just add content-fluid class back and add padding: 0 15px; to content-fluid to support full width layout?

People can use same way to fix full width layout with content-fluid and that is good for all.

ve3 avatar Nov 04 '13 18:11 ve3

@ve3 Was thinking about that. We'll evaluate.

mdo avatar Nov 04 '13 18:11 mdo