Live grid example

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.

1
1
1
1
1
1
1
1
1
2
3
4
4
5
9

Basic grid HTML

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).

  1. <divclass="row">
  2. <divclass="span4">...</div>
  3. <divclass="span8">...</div>
  4. </div>

Given this example, we have .span4 and .span8, making for 12 total columns and a complete row.

Offsetting columns

Move columns to the right using .offset* classes. Each class increases the left margin of a column by a whole column. For example, .offset4 moves .span4 over four columns.

4
3 offset 2
3 offset 1
3 offset 2
6 offset 3
  1. <divclass="row">
  2. <divclass="span4">...</div>
  3. <divclass="span3 offset2">...</div>
  4. </div>

Nesting columns

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.

Level 1 column
Level 2
Level 2
  1. <divclass="row">
  2. <divclass="span9">
  3. Level 1 column
  4. <divclass="row">
  5. <divclass="span6">Level 2</div>
  6. <divclass="span3">Level 2</div>
  7. </div>
  8. </div>
  9. </div>

Need More Information?

Contact us if you would like PME to tender your upcoming project or if you have additional questions about our services. Contact Us