<pclass="lead">Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes <ahref="#grid-example-basic">predefined classes</a> for easy layout options, as well as powerful <ahref="#grid-less">mixins for generating more semantic layouts</a>.</p>
<h3id="grid-intro">Introduction</h3>
<h2id="grid-intro">Introduction</h2>
<p>Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap grid system works:</p>
<ul>
<li>Rows must be placed within a <code>.container</code> (fixed-width) or <code>.container-fluid</code> (full-width) for proper alignment and padding.</li>
...
...
@@ -18,7 +18,7 @@
</ul>
<p>Look to the examples for applying these principles to your code.</p>
<h3id="grid-media-queries">Media queries</h3>
<h2id="grid-media-queries">Media queries</h2>
<p>We use the following media queries in our Less files to create the key breakpoints in our grid system.</p>
{% highlight scss %}
/* Extra small devices (phones, less than 768px) */
...
...
@@ -41,7 +41,7 @@
@media (min-width: @screen-lg-min) { ... }
{% endhighlight %}
<h3id="grid-options">Grid options</h3>
<h2id="grid-options">Grid options</h2>
<p>See how aspects of the Bootstrap grid system work across multiple devices with a handy table.</p>
<p>Using a single set of <code>.col-md-*</code> grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any <code>.row</code>.</p>
<p>Turn any fixed-width grid layout into a full-width layout by changing your outermost <code>.container</code> to <code>.container-fluid</code>.</p>
{% highlight html %}
<divclass="container-fluid">
...
...
@@ -188,7 +188,7 @@
</div>
{% endhighlight %}
<h3id="grid-example-mixed">Example: Mobile and desktop</h3>
<h2id="grid-example-mixed">Example: Mobile and desktop</h2>
<p>Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding <code>.col-xs-*</code><code>.col-md-*</code> to your columns. See the example below for a better idea of how it all works.</p>
<p>With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a <code>.clearfix</code> and our <ahref="#responsive-utilities">responsive utility classes</a>.</p>
<divclass="bs-docs-grid">
<divclass="row show-grid">
...
...
@@ -316,7 +316,7 @@
{% endhighlight %}
<h3id="grid-offsetting">Offsetting columns</h3>
<h2id="grid-offsetting">Offsetting columns</h2>
<p>Move columns to the right using <code>.col-md-offset-*</code> classes. These classes increase the left margin of a column by <code>*</code> columns. For example, <code>.col-md-offset-4</code> moves <code>.col-md-4</code> over four columns.</p>
<divclass="bs-docs-grid">
<divclass="row show-grid">
...
...
@@ -346,7 +346,7 @@
{% endhighlight %}
<h3id="grid-nesting">Nesting columns</h3>
<h2id="grid-nesting">Nesting columns</h2>
<p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-sm-*</code> columns within an existing <code>.col-sm-*</code> column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns).</p>
<divclass="row show-grid">
<divclass="col-sm-9">
...
...
@@ -377,7 +377,7 @@
</div>
{% endhighlight %}
<h3id="grid-column-ordering">Column ordering</h3>
<h2id="grid-column-ordering">Column ordering</h2>
<p>Easily change the order of our built-in grid columns with <code>.col-md-push-*</code> and <code>.col-md-pull-*</code> modifier classes.</p>
<p>In addition to <ahref="#grid-example-basic">prebuilt grid classes</a> for fast layouts, Bootstrap includes Less variables and mixins for quickly generating your own simple, semantic layouts.</p>
<h4>Variables</h4>
<h3>Variables</h3>
<p>Variables determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.</p>
{% highlight scss %}
@grid-columns: 12;
...
...
@@ -402,7 +402,7 @@
@grid-float-breakpoint: 768px;
{% endhighlight %}
<h4>Mixins</h4>
<h3>Mixins</h3>
<p>Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.</p>
{% highlight scss %}
// Creates a wrapper for a series of columns
...
...
@@ -538,7 +538,7 @@
}
{% endhighlight %}
<h4>Example usage</h4>
<h3>Example usage</h3>
<p>You can modify the variables to your own custom values, or just use the mixins with their default values. Here's an example of using the default settings to create a two-column layout with a gap between.</p>
<pclass="lead">Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.</p>
<h3id="overview-doctype">HTML5 doctype</h3>
<h2id="overview-doctype">HTML5 doctype</h2>
<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>
{% highlight html %}
<!DOCTYPE html>
...
...
@@ -12,7 +12,7 @@
</html>
{% endhighlight %}
<h3id="overview-mobile">Mobile first</h3>
<h2id="overview-mobile">Mobile first</h2>
<p>With Bootstrap 2, we added optional mobile friendly styles for key aspects of the framework. With Bootstrap 3, we've rewritten the project to be mobile friendly from the start. Instead of adding on optional mobile styles, they're baked right into the core. In fact, <strong>Bootstrap is mobile first</strong>. Mobile first styles can be found throughout the entire library instead of in separate files.</p>
<p>To ensure proper rendering and touch zooming, <strong>add the viewport meta tag</strong> to your <code><head></code>.</p>
<h3id="overview-type-links">Typography and links</h3>
<h2id="overview-type-links">Typography and links</h2>
<p>Bootstrap sets basic global display, typography, and link styles. Specifically, we:</p>
<ul>
<li>Set <code>background-color: #fff;</code> on the <code>body</code></li>
...
...
@@ -32,10 +32,10 @@
</ul>
<p>These styles can be found within <code>scaffolding.less</code>.</p>
<h3id="overview-normalize">Normalize.css</h3>
<h2id="overview-normalize">Normalize.css</h2>
<p>For improved cross-browser rendering, we use <ahref="http://necolas.github.io/normalize.css/"target="_blank">Normalize.css</a>, a project by <ahref="https://twitter.com/necolas"target="_blank">Nicolas Gallagher</a> and <ahref="https://twitter.com/jon_neal"target="_blank">Jonathan Neal</a>.</p>
<h3id="overview-container">Containers</h3>
<h2id="overview-container">Containers</h2>
<p>Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects. Note that, due to <code>padding</code> and more, neither container is nestable.</p>
<p>Use <code>.container</code> for a responsive fixed width container.</p>