The default Bootstrap grid system utilizes 12 columns, making for a 940px wide container without responsive features enabled. With the responsive CSS file added, the grid adapts to be 724px and 1170px wide depending on your viewport. Below 767px viewports, the columns become fluid and stack vertically.
For a simple two column layout, create a
.row and add the appropriate number of
.span* columns. As this is a 12-column grid, each
.span* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent).
<div class="row"> <div class="span4">...</div> <div class="span8">...</div> </div>
Given this example, we have
.span8, making for 12 total columns and a complete row.
Move columns to the right using
.offset* classes. Each class increases the left margin of a column by a whole column. For example,
.span4 over four columns.
<div class="row"> <div class="span4">...</div> <div class="span3 offset2">...</div> </div>
To nest your content with the default grid, add a new
.row and set of
.span* columns within an existing
.span* column. Nested rows should include a set of columns that add up to the number of columns of its parent.
<div class="row"> <div class="span9"> Level 1 column <div class="row"> <div class="span6">Level 2</div> <div class="span3">Level 2</div> </div> </div> </div>
This page was last modified on Friday, 18th July 2014 at 12:20:00 by Gary Keeling. © 2019 GKWeb Design. not complete
Categorised as: Scaffolding