10

I don't understand why row class has margin-left: -20px (so it grows after parents border like on the image). I think nobody needs this behavior. Or am I doing something wrong?

<div class="container">
        <div id="top-container" class="row">
            <div class="span8">
                <h1>App</h1>
            </div>
            <div class="span4">

            </div>
        </div>
    </div>

example

andreas
  • 16,357
  • 12
  • 72
  • 76
Krab
  • 6,526
  • 6
  • 41
  • 78

2 Answers2

14

You can use row-fluid instead of row, then your span4 and span8 won't have margin-left.

<div class="container">
    <div id="top-container" class="row-fluid">
        <div class="span8">
            <h1>App</h1>
        </div>
        <div class="span4">

        </div>
    </div>
</div>
mauteri
  • 531
  • 3
  • 7
3

For people trying to find this out for Bootstrap 3:

Grids and full-width layouts 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.

Source (search for Grids and full-width layouts)

Yannis Dran
  • 1,479
  • 2
  • 18
  • 24