Created
July 2, 2012 15:42
-
-
Save aeonblue3/3033849 to your computer and use it in GitHub Desktop.
Bootstrap Grid classes example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Bootstrap's grid uses an outer div with a container class. Inside this is a row class | |
that contains the div or divs that will hold the content. To divide up the space in a row | |
use the span classes and offset classes. The numbers used after the offsets and the spans must | |
equal 12 for the 12 column grid system. | |
--> | |
<div class="container"> | |
<div class="row"> | |
<div class="offset4 span8"></div> | |
</div> | |
<div class="row"> | |
<div class="span4"></div> | |
<div class="span4"></div> | |
<div class="span4"></div> | |
</div> | |
</div> | |
<!-- | |
For the responsive grid system, append the '-fluid' to the container | |
and row classes, as shown here. | |
--> | |
<div class="container-fluid"> | |
<div class="row-fluid"> | |
<div class="offset4 span8"></div> | |
</div> | |
<div class="row-fluid"> | |
<div class="span4"></div> | |
<div class="span4"></div> | |
<div class="span4"></div> | |
</div> | |
</div> | |
<!-- | |
Also, you can nest as follows. Notice the nested row has spans that add up to the | |
parent span. | |
--> | |
<div class="container"> | |
<div class="row"> | |
<div class="span8"> | |
I am the parent span of 8 columns, still with in the 12 column grid | |
<div class="row"> | |
<div class="span4">I am 4 columns</div> | |
<div class="span4">I am also 4 columns</div> | |
</div> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment