2012-01-24 00:17:32 +01:00
<!-- Masthead
================================================== -->
<header class="jumbotron subhead" id="overview">
2012-01-24 23:08:03 +01:00
<h1>{{_i}}Scaffolding{{/i}}</h1>
<p class="lead">{{_i}}Bootstrap is built on a responsive 12-column grid. We've also included fixed- and fluid-width layouts based on that system.{{/i}}</p>
2012-01-25 04:19:50 +01:00
<div class="subnav">
2012-01-31 06:29:50 +01:00
<ul class="nav nav-pills">
2012-01-25 10:22:29 +01:00
<li><a href="#grid-system">{{_i}}Grid system{{/i}}</a></li>
<li><a href="#layouts">{{_i}}Layouts{{/i}}</a></li>
<li><a href="#responsive">{{_i}}Responsive design{{/i}}</a></li>
2012-01-25 04:19:50 +01:00
</ul>
</div>
2012-01-24 00:17:32 +01:00
</header>
2012-01-23 23:14:16 +01:00
<!-- Grid system
================================================== -->
<section id="grid-system">
<div class="page-header">
2012-01-24 23:08:03 +01:00
<h1>{{_i}}Grid system <small>12 columns with a responsive twist</small>{{/i}}</h1>
2012-01-23 23:14:16 +01:00
</div>
<h2>Default 940px grid</h2>
<div class="row show-grid">
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
<div class="span1">1</div>
</div>
<div class="row show-grid">
<div class="span4">4</div>
<div class="span4">4</div>
<div class="span4">4</div>
</div>
<div class="row show-grid">
<div class="span4">4</div>
<div class="span8">8</div>
</div>
<div class="row show-grid">
<div class="span6">6</div>
<div class="span6">6</div>
</div>
<div class="row show-grid">
<div class="span12">12</div>
</div>
<div class="row">
<div class="span4">
2012-01-24 23:08:03 +01:00
<p>{{_i}}The default grid system provided as part of Bootstrap is a <strong>940px-wide, 12-column grid</strong>.{{/i}}</p>
2012-01-29 23:07:14 +01:00
<p>{{_i}}It also has four responsive variations for various devices and resolutions: phone, tablet portrait, table landscape and small desktops, and large widescreen desktops.{{/i}}</p>
2012-01-23 23:14:16 +01:00
</div>
<div class="span4">
<pre class="prettyprint linenums">
<div class="row">
<div class="span4">...</div>
<div class="span8">...</div>
</div>
</pre>
</div>
<div class="span4">
2012-01-24 23:08:03 +01:00
<p>{{_i}}As shown here, a basic layout can be created with two "columns," each spanning a number of the 12 foundational columns we defined as part of our grid system.{{/i}}</p>
2012-01-23 23:14:16 +01:00
</div>
</div><!-- /row -->
2012-01-27 18:36:49 +01:00
<br>
2012-01-23 23:14:16 +01:00
<h2>Offsetting columns</h2>
<div class="row show-grid">
<div class="span4">4</div>
<div class="span4 offset4">4 offset 4</div>
</div><!-- /row -->
<div class="row show-grid">
<div class="span3 offset3">3 offset 3</div>
<div class="span3 offset3">3 offset 3</div>
</div><!-- /row -->
<div class="row show-grid">
<div class="span8 offset4">8 offset 4</div>
</div><!-- /row -->
2012-01-27 18:36:49 +01:00
<pre class="prettyprint linenums">
<div class="row">
<div class="span4">...</div>
<div class="span4 offset4">...</div>
</div>
</pre>
2012-01-23 23:14:16 +01:00
<br>
2012-01-24 23:08:03 +01:00
<h2>{{_i}}Nesting columns{{/i}}</h2>
2012-01-23 23:14:16 +01:00
<div class="row">
<div class="span6">
2012-01-24 23:08:03 +01:00
<p>{{_i}}With the static (non-fluid) grid system in Bootstrap, nesting is easy. To nest your content, just add a new <code>.row</code> and set of <code>.span*</code> columns within an existing <code>.span*</code> column.{{/i}}</p>
<h4>{{_i}}Example{{/i}}</h4>
2012-01-23 23:14:16 +01:00
<div class="row show-grid">
<div class="span6">
2012-01-24 23:08:03 +01:00
{{_i}}Level 1 of column{{/i}}
2012-01-23 23:14:16 +01:00
<div class="row show-grid">
<div class="span3">
2012-01-24 23:08:03 +01:00
{{_i}}Level 2{{/i}}
2012-01-23 23:14:16 +01:00
</div>
<div class="span3">
2012-01-24 23:08:03 +01:00
{{_i}}Level 2{{/i}}
2012-01-23 23:14:16 +01:00
</div>
</div>
</div>
</div>
</div>
<div class="span6">
<pre class="prettyprint linenums">
<div class="row">
<div class="span12">
2012-01-24 23:08:03 +01:00
{{_i}}Level 1 of column{{/i}}
2012-01-23 23:14:16 +01:00
<div class="row">
2012-01-24 23:08:03 +01:00
<div class="span6">{{_i}}Level 2{{/i}}</div>
<div class="span6">{{_i}}Level 2{{/i}}</div>
2012-01-23 23:14:16 +01:00
</div>
</div>
</div>
</pre>
</div>
</div>
2012-01-24 23:08:03 +01:00
<h2>{{_i}}Grid customization{{/i}}</h2>
2012-01-23 23:14:16 +01:00
<table class="table table-bordered table-striped">
<thead>
<tr>
2012-01-24 23:08:03 +01:00
<th>{{_i}}Variable{{/i}}</th>
<th>{{_i}}Default value{{/i}}</th>
<th>{{_i}}Description{{/i}}</th>
2012-01-23 23:14:16 +01:00
</tr>
</thead>
<tbody>
<tr>
<td><code>@gridColumns</code></td>
<td>12</td>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Number of columns{{/i}}</td>
2012-01-23 23:14:16 +01:00
</tr>
<tr>
<td><code>@gridColumnWidth</code></td>
<td>60px</td>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Width of each column{{/i}}</td>
2012-01-23 23:14:16 +01:00
</tr>
<tr>
<td><code>@gridGutterWidth</code></td>
<td>20px</td>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Negative space between columns{{/i}}</td>
2012-01-23 23:14:16 +01:00
</tr>
<tr>
<td><code>@siteWidth</code></td>
2012-01-24 23:08:03 +01:00
<td><em>{{_i}}Computed sum of all columns and gutters{{/i}}</em></td>
2012-01-26 00:03:44 +01:00
<td>{{_i}}Counts number of columns and gutters to set width of the <code>.container-fixed()</code> mixin{{/i}}</td>
2012-01-23 23:14:16 +01:00
</tr>
</tbody>
</table>
<div class="row">
<div class="span4">
2012-01-24 23:08:03 +01:00
<h3>{{_i}}Variables in LESS{{/i}}</h3>
<p>{{_i}}Built into Bootstrap are a handful of variables for customizing the default 940px grid system, documented above. All variables for the grid are stored in variables.less.{{/i}}</p>
2012-01-23 23:14:16 +01:00
</div>
<div class="span4">
2012-01-24 23:08:03 +01:00
<h3>{{_i}}How to customize{{/i}}</h3>
2012-02-01 18:58:08 +01:00
<p>{{_i}}Modifying the grid means changing the three <code>@grid*</code> variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the <a href="less.html#compiling">four ways documented to recompile</a>. If you're adding more columns, be sure to add the CSS for those in grid.less.{{/i}}</p>
2012-01-23 23:14:16 +01:00
</div>
<div class="span4">
2012-01-24 23:08:03 +01:00
<h3>{{_i}}Staying responsive{{/i}}</h3>
<p>{{_i}}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 customize the grids in responsive.less.{{/i}}</p>
2012-01-23 23:14:16 +01:00
</div>
</div><!-- /row -->
</section>
<!-- Layouts (Default and fluid)
================================================== -->
<section id="layouts">
<div class="page-header">
2012-01-24 23:08:03 +01:00
<h1>{{_i}}Layouts <small>Basic templates to create webpages</small>{{/i}}</h1>
2012-01-23 23:14:16 +01:00
</div>
<div class="row">
<div class="span6">
2012-01-24 23:08:03 +01:00
<h2>{{_i}}Fixed layout{{/i}}</h2>
<p>{{_i}}The default and simple 940px-wide, centered layout for just about any website or page provided by a single <code><div class="container"></code>.{{/i}}</p>
2012-01-31 09:11:19 +01:00
<div class="minicon-layout">
<div class="minicon-layout-body"></div>
2012-01-23 23:14:16 +01:00
</div>
<pre class="prettyprint linenums">
<body>
<div class="container">
...
</div>
</body>
</pre>
</div><!-- /col -->
<div class="span6">
2012-01-24 23:08:03 +01:00
<h2>{{_i}}Fluid layout{{/i}}</h2>
2012-01-31 08:10:29 +01:00
<p>{{_i}}<code><div class="container-fluid"></code> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.{{/i}}</p>
2012-01-31 09:11:19 +01:00
<div class="minicon-layout fluid">
<div class="minicon-layout-sidebar"></div>
<div class="minicon-layout-body"></div>
2012-01-23 23:14:16 +01:00
</div>
<pre class="prettyprint linenums">
2012-01-31 08:10:29 +01:00
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<!--{{_i}}Sidebar content{{/i}}-->
2012-01-23 23:14:16 +01:00
</div>
2012-01-31 08:10:29 +01:00
<div class="span10">
<!--{{_i}}Body content{{/i}}-->
2012-01-23 23:14:16 +01:00
</div>
</div>
2012-01-31 08:10:29 +01:00
</div>
2012-01-23 23:14:16 +01:00
</pre>
</div><!-- /col -->
</div><!-- /row -->
</section>
<!-- Responsive design
================================================== -->
<section id="responsive">
<div class="page-header">
2012-01-24 23:08:03 +01:00
<h1>{{_i}}Responsive design <small>Media queries for various devices and resolutions</small>{{/i}}</h1>
2012-01-23 23:14:16 +01:00
</div>
<!-- Supported devices -->
<div class="row">
<div class="span4">
<img src="assets/img/responsive-illustrations.png" alt="Responsive devices">
</div>
<div class="span8">
2012-01-24 23:08:03 +01:00
<h2>{{_i}}Supported devices{{/i}}</h2>
<p>{{_i}}Bootstrap supports a handful of media queries to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:{{/i}}</p>
2012-01-23 23:14:16 +01:00
<table class="table table-bordered table-striped">
<thead>
<tr>
2012-01-24 23:08:03 +01:00
<th>{{_i}}Label{{/i}}</th>
<th>{{_i}}Layout width{{/i}}</th>
<th>{{_i}}Column width{{/i}}</th>
<th>{{_i}}Gutter width{{/i}}</th>
2012-01-23 23:14:16 +01:00
</tr>
</thead>
<tbody>
<tr>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Smartphones{{/i}}</td>
2012-01-23 23:14:16 +01:00
<td>480px and below</td>
2012-01-24 23:08:03 +01:00
<td class="muted" colspan="2">{{_i}}Fluid columns, no fixed widths{{/i}}</td>
2012-01-23 23:14:16 +01:00
</tr>
<tr>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Portrait tablets{{/i}}</td>
2012-01-23 23:14:16 +01:00
<td>480px to 768px</td>
2012-01-24 23:08:03 +01:00
<td class="muted" colspan="2">{{_i}}Fluid columns, no fixed widths{{/i}}</td>
2012-01-23 23:14:16 +01:00
</tr>
<tr>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Landscape tablets{{/i}}</td>
2012-02-02 03:12:14 +01:00
<td>768px to 980px</td>
2012-01-23 23:14:16 +01:00
<td>44px</td>
<td>20px</td>
</tr>
<tr>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Default{{/i}}</td>
2012-02-02 03:12:14 +01:00
<td>980px and up</td>
2012-01-23 23:14:16 +01:00
<td>60px</td>
<td>20px</td>
</tr>
<tr>
2012-01-24 23:08:03 +01:00
<td>{{_i}}Large display{{/i}}</td>
2012-01-23 23:14:16 +01:00
<td>1210px and up</td>
<td>70px</td>
<td>30px</td>
</tr>
</tbody>
</table>
2012-01-24 23:08:03 +01:00
<h3>{{_i}}What they do{{/i}}</h3>
<p>{{_i}}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>.{{/i}}</p>
2012-01-23 23:14:16 +01:00
<ul>
2012-01-24 23:08:03 +01:00
<li>{{_i}}Modify the width of column in our grid{{/i}}</li>
<li>{{_i}}Stack elements instead of float wherever necessary{{/i}}</li>
<li>{{_i}}Resize headings and text to be more appropriate for devices{{/i}}</li>
2012-01-23 23:14:16 +01:00
</ul>
</div>
</div>
<br>
<!-- Media query code -->
2012-01-24 23:08:03 +01:00
<h2>{{_i}}Using the media queries{{/i}}</h2>
2012-01-23 23:14:16 +01:00
<div class="row">
<div class="span5">
2012-01-24 23:08:03 +01:00
<p>{{_i}}Bootstrap doesn't automatically include these media queries, but understanding and adding them is very easy and requires minimal setup. You have a few options for including the responsive features of Bootstrap:{{/i}}</p>
2012-01-23 23:14:16 +01:00
<ol>
2012-01-27 03:10:36 +01:00
<li>{{_i}}Use the compiled responsive version, bootstrap-responsive.css{{/i}}</li>
2012-01-24 23:08:03 +01:00
<li>{{_i}}Add @import "responsive.less" and recompile Bootstrap{{/i}}</li>
2012-01-25 18:57:40 +01:00
<li>{{_i}}Modify and recompile responsive.less as a separate{{/i}}</li>
2012-01-23 23:14:16 +01:00
</ol>
2012-01-24 23:08:03 +01:00
<p>{{_i}}<strong>Why not just include it?</strong> Truth be told, not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it.{{/i}}</p>
2012-01-23 23:14:16 +01:00
</div>
<div class="span7">
<pre class="prettyprint linenums">
2012-01-24 23:08:03 +01:00
// {{_i}}Landscape phones and down{{/i}}
2012-01-23 23:14:16 +01:00
@media (max-width: 480px) { ... }
2012-01-24 23:08:03 +01:00
// {{_i}}Landscape phone to portrait tablet{{/i}}
2012-01-25 18:57:40 +01:00
@media (max-width: 768px) { ... }
2012-01-23 23:14:16 +01:00
2012-01-24 23:08:03 +01:00
// {{_i}}Portrait tablet to landscape and desktop{{/i}}
2012-02-02 03:12:14 +01:00
@media (min-width: 768px) and (max-width: 980px) { ... }
2012-01-23 23:14:16 +01:00
2012-01-24 23:08:03 +01:00
// {{_i}}Large desktop{{/i}}
2012-01-29 05:34:07 +01:00
@media (min-width: 1200px) { .. }
2012-01-23 23:14:16 +01:00
</pre>
</div>
</div>
2012-01-27 03:10:36 +01:00
</section>