<p>Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.</p>
<p>With Bootstrap 2, the old reset block has been dropped in favor of <ahref="http://necolas.github.com/normalize.css/"target="_blank">Normalize.css</a>, a project by <ahref="http://twitter.com/necolas"target="_blank">Nicolas Gallagher</a> that also powers the <ahref="http://html5boilerplate.com"target="_blank">HTML5 Boilerplate</a>. While we use much of Normalize within our <strong>reset.less</strong>, we have removed some elements specifically for Bootstrap.</p>
<p>The default Bootstrap grid system utilizes <strong>12 columns</strong>, making for a 940px wide container without <ahref="#responsive">responsive features</a> 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.</p>
<p>For a simple two column layout, create a <code>.row</code> and add the appropriate number of <code>.span*</code> columns. As this is a 12-column grid, each <code>.span*</code> spans a number of those 12 columns, and should always add up to 12 for each row.</p>
<p>Given this example, we have <code>.span4</code> and <code>.span8</code>, making for 12 total columns and a complete row.</p>
<h2>Offsetting columns</h2>
<p>Move columns to the left using <code>.offset*</code> classes. Each class increases the left margin of a column by a whole column. For example, <code>.offset4</code> moves <code>.span4</code> over four columns.</p>
<p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.span*</code> columns within an existing <code>.span*</code> column. Nested rows should include a set of columns that add up to the number of columns of its parent.</p>
<h3>Example</h3>
<p>Here two nested <code>.span4</code> columns are placed within a <code>.span8</code>.</p>
<p>The fluid grid system uses percents instead of pixels for column widths. It has the same responsive capabilities as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.</p>
<p>Make any row "fluid" by changing <code>.row</code> to <code>.row-fluid</code>. The column classes stay the exact same, making it easy to flip between fixed and fluid grids.</p>
<p>Nesting with fluid grids is a bit different: the number of nested columns should not match the parent's number of columns. Instead, each level of nested columns are reset because each row takes up 100% of the parent column.</p>
<p>The default grid is built on a few variables for easy customization via LESS. All variables can be found in <strong>variables.less</strong>.</p>
<tableclass="table table-bordered table-striped">
<thead>
<tr>
<th>Variable</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>@gridColumns</code></td>
<td>12</td>
<td>Number of columns</td>
</tr>
<tr>
<td><code>@gridColumnWidth</code></td>
<td>60px</td>
<td>Width of each column</td>
</tr>
<tr>
<td><code>@gridGutterWidth</code></td>
<td>20px</td>
<td>Negative space between columns</td>
</tr>
<tr>
<td><code>@fluidGridColumnWidth</code></td>
<td>6.382978723%</td>
<td>Width of each fluid column</td>
</tr>
<tr>
<td><code>@fluidGridGutterWidth</code></td>
<td>2.127659574%</td>
<td>Negative space between fluid columns</td>
</tr>
</tbody>
</table>
<h3>How to customize</h3>
<p>Modifying the grid means changing the three <code>@grid*</code> variables and recompiling Bootstrap. Change the grid variables in <strong>variables.less</strong> and use one of the <ahref="less.html#compiling">four ways documented to recompile</a>. If you're adding more columns, be sure to add the CSS for those in <strong>grid.less</strong>.</p>
<h2>Staying responsive</h2>
<p>Customization of the grid only works at the default level, the 940px grid. To maintain the responsive aspects of Bootstrap, you'll also have to manually customize the grids in <strong>responsive.less</strong> until a future update improves this.</p>
<p>Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the <code><head></code> of your document. If you've compiled Bootstrap from the Customize page, you need only include the meta tag.</p>
<p><spanclass="label label-info">Heads up!</span> Bootstrap doesn't include responsive features by default at this time as not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it as needed.</p>
<h2>About responsive Bootstrap</h2>
<imgsrc="assets/img/responsive-illustrations.png"alt="Responsive devices"style="float: right; margin: 0 0 20px 20px;">
<p>Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around <code>min-width</code> and <code>max-width</code>.</p>
<ul>
<li>Modify the width of column in our grid</li>
<li>Stack elements instead of float wherever necessary</li>
<li>Resize headings and text to be more appropriate for devices</li>
</ul>
<p>Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.</p>
<h2>Supported devices</h2>
<p>Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:</p>
<tableclass="table table-bordered table-striped">
<thead>
<tr>
<th>Label</th>
<th>Layout width</th>
<th>Column width</th>
<th>Gutter width</th>
</tr>
</thead>
<tbody>
<tr>
<td>Phones</td>
<td>480px and below</td>
<tdclass="muted"colspan="2">Fluid columns, no fixed widths</td>
</tr>
<tr>
<td>Phones to tablets</td>
<td>767px and below</td>
<tdclass="muted"colspan="2">Fluid columns, no fixed widths</td>
<p>For faster mobile-friendly development, use these utility classes for showing and hiding content by device. Below is a table of the available classes and their effect on a given media query layout (labeled by device). They can be found in <code>responsive.less</code>.</p>
<p>Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.</p>
<h3>Responsive utilities test case</h3>
<p>Resize your browser or load on different devices to test the above classes.</p>
<h4>Visible on...</h4>
<p>Green checkmarks indicate that class is visible in your current viewport.</p>
<p>Designed and built with all the love in the world <ahref="http://twitter.com/twitter"target="_blank">@twitter</a> by <ahref="http://twitter.com/mdo"target="_blank">@mdo</a> and <ahref="http://twitter.com/fat"target="_blank">@fat</a>.</p>
<p>Code licensed under the <ahref="http://www.apache.org/licenses/LICENSE-2.0"target="_blank">Apache License v2.0</a>. Documentation licensed under <ahref="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<p>Icons from <ahref="http://glyphicons.com">Glyphicons Free</a>, licensed under <ahref="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>