Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do padding on a fluid row in twitter bootstrap

<div class="internal-wrapper row-fluid">
        <div class="Header span12"> 
                <div class="HeaderTitle span6"></div>
                <div class="span6"></div>
        </div>
</div>

Now, when I do padding on internal-wrapper, I am expecting the padding to effect on the entire grid! inside it. But an overflow is occurring (I think, the right padding is not working)

.internal-wrapper {
     padding-left: 30px;
     padding-right: 30px;
}

enter image description here

The blue bar below represents Header class. The green box, represents padding! So, Its happening on left but not right

like image 626
Surya Avatar asked Feb 06 '13 17:02

Surya


1 Answers

.row-fluid is 100% width. Because it's using a border-box layout, any padding you put is added to that 100%. See http://paulirish.com/2012/box-sizing-border-box-ftw/. However, setting it to use the content-box model will probably cause other problems in Bootstrap.

How to fix it - add an inner element with the padding.

<div class="row-fluid">
  <div style="padding-left: 30px; padding-right: 30px;">
     ...
  </div>
</div>
like image 180
Dan Blows Avatar answered Oct 22 '22 04:10

Dan Blows