I’ve been playing with the Twitter Bootstrap grid system, and noticed that I could mix row and row-fluid in the following way:
<div class="row">
<div class="span8">
...
</div>
<div class="span4>
<div class="row-fluid">
<div class="span8">
...
</div>
<div class="span4">
...
</div>
</div>
</div>
</div>
That works for me, however I’m not sure if I can rely on this behaviour to stay consistent. If find the documentation to be unclear on this subject.
Is this a documented, and reliable, use of the grid system? Or should I only use row-fluid inside another row-fluid?
The main purposes of
.row-fluidis to alter the styling of.spanXelements.Within
.row,.spanXelements have a fixed pixel width. This width may change based on viewport dimensions if you’re using the responsive stylesheet.Within
.row-fluid, however,.spanXelements have a percentage-based width. One of the nice side effects here is that a.row-fluidelement can be placed inside any element, and it will simply size itself to 100% of the container’s width. Likewise, any.spanXelements within this fluid row will size themselves accordingly, so that each ‘column’ is roughly one 12th (accounting for gutter width) of the.row-fluidcontainer, regardless of the row’s width or location in the DOM.If there is any area of your page that you want to split into some set number of columns,
.row-fluidcan be used.