css.html 131 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
2
3
4
---
layout: default
title: CSS
slug: css
Mark Otto's avatar
Mark Otto committed
5
lead: "Global CSS settings, fundamental HTML elements styled and enhanced with extensible classes, and an advanced grid system."
Mark Otto's avatar
Mark Otto committed
6
7
8
9
10
---


  <!-- Global Bootstrap settings
  ================================================== -->
Mark Otto's avatar
Mark Otto committed
11
  <div class="bs-docs-section">
Mark Otto's avatar
Mark Otto committed
12
    <div class="page-header">
Mark Otto's avatar
Mark Otto committed
13
      <h1 id="overview">Overview</h1>
Mark Otto's avatar
Mark Otto committed
14
15
16
    </div>
    <p class="lead">Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.</p>

17
    <h3 id="overview-doctype">HTML5 doctype</h3>
Mark Otto's avatar
Mark Otto committed
18
19
20
21
22
23
24
25
    <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>
<html lang="en">
  ...
</html>
{% endhighlight %}

26
    <h3 id="overview-mobile">Mobile first</h3>
Mark Otto's avatar
Mark Otto committed
27
28
29
30
    <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>&lt;head&gt;</code>.</p>
{% highlight html %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
31
{% endhighlight %}
32
    <p>You can disable zooming capabilities on mobile devices by adding <code>user-scalable=no</code> to the viewport meta tag. This disables zooming, meaning users are only able to scroll, and results in your site feeling a bit more like a native application. Overall we don't recommend this on every site, so use caution!</p>
33
34
{% highlight html %}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
35
36
37
38
39
{% endhighlight %}

    <h3 id="overview-responsive-images">Responsive images</h3>
    <p>Images in Bootstrap 3 can be made responsive-friendly via the addition of the <code>.img-responsive</code> class. This applies <code>max-width: 100%;</code> and <code>height: auto;</code> to the image so that it scales nicely to the parent element.</p>
{% highlight html %}
Mark Otto's avatar
typo    
Mark Otto committed
40
<img src="..." class="img-responsive" alt="Responsive image">
Mark Otto's avatar
Mark Otto committed
41
42
{% endhighlight %}

43
    <h3 id="overview-type-links">Typography and links</h3>
Mark Otto's avatar
Mark Otto committed
44
45
    <p>Bootstrap sets basic global display, typography, and link styles. Specifically, we:</p>
    <ul>
Zlatan Vasović's avatar
Zlatan Vasović committed
46
      <li>Set <code>background-color: #fff;</code> on the <code>body</code></li>
Mark Otto's avatar
Mark Otto committed
47
48
49
      <li>Use the <code>@font-family-base</code>, <code>@font-size-base</code>, and <code>@line-height-base</code> attributes as our typographic base</li>
      <li>Set the global link color via <code>@link-color</code> and apply link underlines only on <code>:hover</code></li>
    </ul>
Chris Rebert's avatar
Chris Rebert committed
50
    <p>These styles can be found within <code>scaffolding.less</code>.</p>
Mark Otto's avatar
Mark Otto committed
51

52
    <h3 id="overview-normalize">Normalize</h3>
53
    <p>For improved cross-browser rendering, we use <a href="http://necolas.github.io/normalize.css/" target="_blank">Normalize</a>, a project by <a href="http://twitter.com/necolas" target="_blank">Nicolas Gallagher</a> and <a href="http://twitter.com/jon_neal" target="_blank">Jonathan Neal</a>.</p>
54

55
    <h3 id="overview-container">Containers</h3>
56
57
    <p>Easily center a page's contents by wrapping its contents in a <code>.container</code>. Containers set <code>width</code> at various media query breakpoints to match our grid system.</p>
    <p>Note that, due to <code>padding</code> and fixed widths, containers are not nestable by default.</p>
58
59
60
61
62
{% highlight html %}
<div class="container">
  ...
</div>
{% endhighlight %}
Mark Otto's avatar
Mark Otto committed
63
64
65
66
67
68
  </div>



  <!-- Grid system
  ================================================== -->
Mark Otto's avatar
Mark Otto committed
69
  <div class="bs-docs-section">
Mark Otto's avatar
Mark Otto committed
70
    <div class="page-header">
Mark Otto's avatar
Mark Otto committed
71
      <h1 id="grid">Grid system</h1>
Mark Otto's avatar
Mark Otto committed
72
    </div>
Mark Otto's avatar
Mark Otto committed
73
    <p class="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 <a href="#grid-example-basic">predefined classes</a> for easy layout options, as well as powerful <a href="#grid-less">mixins for generating more semantic layouts</a>.</p>
Mark Otto's avatar
Mark Otto committed
74

75
76
    <h3 id="grid-intro">Introduction</h3>
    <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>
Mark Otto's avatar
Mark Otto committed
77
    <ul>
78
      <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>
79
80
      <li>Use rows to create horizontal groups of columns.</li>
      <li>Content should be placed within columns, and only columns may be immediate children of rows.</li>
81
      <li>Predefined grid classes like <code>.row</code> and <code>.col-xs-4</code> are available for quickly making grid layouts. Less mixins can also be used for more semantic layouts.</li>
82
      <li>Columns create gutters (gaps between column content) via <code>padding</code>. That padding is offset in rows for the first and last column via negative margin on <code>.row</code>s.</li>
83
      <li>Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three <code>.col-xs-4</code>.</li>
Mark Otto's avatar
Mark Otto committed
84
    </ul>
85
    <p>Look to the examples for applying these principles to your code.</p>
Mark Otto's avatar
Mark Otto committed
86

87
88
89
90
91
    <div class="bs-callout bs-callout-info">
      <h4>Grids and full-width layouts</h4>
      <p>Folks looking to create fully fluid layouts (meaning your site stretches the entire width of the viewport) must wrap their grid content in a containing element with <code>padding: 0 15px;</code> to offset the <code>margin: 0 -15px;</code> used on <code>.row</code>s.</p>
    </div>

92
    <h3 id="grid-media-queries">Media queries</h3>
93
    <p>We use the following media queries in our Less files to create the key breakpoints in our grid system.</p>
94
{% highlight css %}
Chris Rebert's avatar
Chris Rebert committed
95
/* Extra small devices (phones, less than 768px) */
96
97
98
/* No media query since this is the default in Bootstrap */

/* Small devices (tablets, 768px and up) */
99
@media (min-width: @screen-sm-min) { ... }
100

101
/* Medium devices (desktops, 992px and up) */
102
@media (min-width: @screen-md-min) { ... }
103
104

/* Large devices (large desktops, 1200px and up) */
105
@media (min-width: @screen-lg-min) { ... }
106
{% endhighlight %}
107
    <p>We occasionally expand on these media queries to include a <code>max-width</code> to limit CSS to a narrower set of devices.</p>
108
{% highlight css %}
109
110
111
112
@media (max-width: @screen-xs-max) { ... }
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { ... }
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) { ... }
@media (min-width: @screen-lg-min) { ... }
113
114
{% endhighlight %}

Mark Otto's avatar
Mark Otto committed
115
    <h3 id="grid-options">Grid options</h3>
Mark Otto's avatar
Mark Otto committed
116
    <p>See how aspects of the Bootstrap grid system work across multiple devices with a handy table.</p>
117
118
    <div class="table-responsive">
      <table class="table table-bordered table-striped">
119
120
121
122
        <thead>
          <tr>
            <th></th>
            <th>
123
              Extra small devices
Guillermo González de Agüero's avatar
Guillermo González de Agüero committed
124
              <small>Phones (&lt;768px)</small>
125
126
            </th>
            <th>
127
              Small devices
128
              <small>Tablets (&ge;768px)</small>
129
130
            </th>
            <th>
131
              Medium devices
Bas Bosman's avatar
Bas Bosman committed
132
              <small>Desktops (&ge;992px)</small>
133
134
135
            </th>
            <th>
              Large devices
Bas Bosman's avatar
Bas Bosman committed
136
              <small>Desktops (&ge;1200px)</small>
137
138
139
140
141
142
143
            </th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th>Grid behavior</th>
            <td>Horizontal at all times</td>
144
145
146
            <td colspan="3">Collapsed to start, horizontal above breakpoints</td>
          </tr>
          <tr>
147
            <th>Container width</th>
148
            <td>None (auto)</td>
149
150
151
            <td>750px</td>
            <td>970px</td>
            <td>1170px</td>
152
153
154
          </tr>
          <tr>
            <th>Class prefix</th>
Matthew Leffler's avatar
Typo    
Matthew Leffler committed
155
            <td><code>.col-xs-</code></td>
156
            <td><code>.col-sm-</code></td>
157
158
            <td><code>.col-md-</code></td>
            <td><code>.col-lg-</code></td>
159
160
161
          </tr>
          <tr>
            <th># of columns</th>
162
163
164
165
            <td colspan="4">12</td>
          </tr>
          <tr>
            <th>Max column width</th>
166
167
168
169
            <td class="text-muted">Auto</td>
            <td>60px</td>
            <td>78px</td>
            <td>95px</td>
170
171
172
173
          </tr>
          <tr>
            <th>Gutter width</th>
            <td colspan="4">30px (15px on each side of a column)</td>
174
175
176
          </tr>
          <tr>
            <th>Nestable</th>
177
            <td colspan="4">Yes</td>
178
179
180
          </tr>
          <tr>
            <th>Offsets</th>
Chris Rebert's avatar
Chris Rebert committed
181
            <td colspan="4">Yes</td>
182
183
184
          </tr>
          <tr>
            <th>Column ordering</th>
Chris Rebert's avatar
Chris Rebert committed
185
            <td colspan="4">Yes</td>
186
187
188
189
          </tr>
        </tbody>
      </table>
    </div>
190
    <p>Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, applying any <code>.col-md-</code> class to an element will not only affect its styling on medium devices but also on large devices if a <code>.col-lg-</code> class is not present.</p>
Mark Otto's avatar
Mark Otto committed
191

Mark Otto's avatar
Mark Otto committed
192
    <h3 id="grid-example-basic">Example: Stacked-to-horizontal</h3>
Mark Otto's avatar
Mark Otto committed
193
    <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>
Mark Otto's avatar
Mark Otto committed
194
195
    <div class="bs-docs-grid">
      <div class="row show-grid">
196
197
198
199
200
201
202
203
204
205
206
207
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
        <div class="col-md-1">.col-md-1</div>
Mark Otto's avatar
Mark Otto committed
208
      </div>
Mark Otto's avatar
Mark Otto committed
209
      <div class="row show-grid">
210
211
        <div class="col-md-8">.col-md-8</div>
        <div class="col-md-4">.col-md-4</div>
Mark Otto's avatar
Mark Otto committed
212
      </div>
Mark Otto's avatar
Mark Otto committed
213
      <div class="row show-grid">
214
215
216
        <div class="col-md-4">.col-md-4</div>
        <div class="col-md-4">.col-md-4</div>
        <div class="col-md-4">.col-md-4</div>
Mark Otto's avatar
Mark Otto committed
217
218
      </div>
      <div class="row show-grid">
219
220
        <div class="col-md-6">.col-md-6</div>
        <div class="col-md-6">.col-md-6</div>
Mark Otto's avatar
Mark Otto committed
221
222
223
224
      </div>
    </div>
{% highlight html %}
<div class="row">
225
226
227
228
229
230
231
232
233
234
235
236
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
Mark Otto's avatar
Mark Otto committed
237
</div>
238
<div class="row">
239
240
  <div class="col-md-8">.col-md-8</div>
  <div class="col-md-4">.col-md-4</div>
Mark Otto's avatar
Mark Otto committed
241
</div>
Mark Otto's avatar
Mark Otto committed
242
<div class="row">
243
244
245
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
Mark Otto's avatar
Mark Otto committed
246
247
</div>
<div class="row">
248
249
  <div class="col-md-6">.col-md-6</div>
  <div class="col-md-6">.col-md-6</div>
Mark Otto's avatar
Mark Otto committed
250
</div>
251
252
253
254
255
256
257
258
259
260
{% endhighlight %}

    <h3 id="grid-example-fluid">Example: Fluid container</h3>
    <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 %}
<div class="container-fluid">
  <div class="row">
    ...
  </div>
</div>
Mark Otto's avatar
Mark Otto committed
261
262
{% endhighlight %}

263
    <h3 id="grid-example-mixed">Example: Mobile and desktop</h3>
264
    <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>
Mark Otto's avatar
Mark Otto committed
265
266
    <div class="bs-docs-grid">
      <div class="row show-grid">
267
        <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
268
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
Mark Otto's avatar
Mark Otto committed
269
270
      </div>
      <div class="row show-grid">
271
272
273
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
Mark Otto's avatar
Mark Otto committed
274
275
      </div>
      <div class="row show-grid">
276
277
        <div class="col-xs-6">.col-xs-6</div>
        <div class="col-xs-6">.col-xs-6</div>
Mark Otto's avatar
Mark Otto committed
278
279
280
      </div>
    </div>
{% highlight html %}
281
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
Mark Otto's avatar
Mark Otto committed
282
<div class="row">
283
  <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
284
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
Mark Otto's avatar
Mark Otto committed
285
</div>
286
287

<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
Mark Otto's avatar
Mark Otto committed
288
<div class="row">
289
290
291
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
Mark Otto's avatar
Mark Otto committed
292
</div>
293
294

<!-- Columns are always 50% wide, on mobile and desktop -->
Mark Otto's avatar
Mark Otto committed
295
<div class="row">
296
297
  <div class="col-xs-6">.col-xs-6</div>
  <div class="col-xs-6">.col-xs-6</div>
Mark Otto's avatar
Mark Otto committed
298
299
300
</div>
{% endhighlight %}

301
    <h3 id="grid-example-mixed-complete">Example: Mobile, tablet, desktops</h3>
Mark Otto's avatar
Mark Otto committed
302
303
304
    <p>Build on the previous example by creating even more dynamic and powerful layouts with tablet <code>.col-sm-*</code> classes.</p>
    <div class="bs-docs-grid">
      <div class="row show-grid">
305
        <div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
306
        <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
Mark Otto's avatar
Mark Otto committed
307
308
      </div>
      <div class="row show-grid">
309
310
        <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
        <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
311
312
        <!-- Optional: clear the XS cols if their content doesn't match in height -->
        <div class="clearfix visible-xs"></div>
313
        <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
Mark Otto's avatar
Mark Otto committed
314
315
316
317
      </div>
    </div>
{% highlight html %}
<div class="row">
318
  <div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
319
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
Mark Otto's avatar
Mark Otto committed
320
321
</div>
<div class="row">
322
323
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
324
325
  <!-- Optional: clear the XS cols if their content doesn't match in height -->
  <div class="clearfix visible-xs"></div>
326
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
Mark Otto's avatar
Mark Otto committed
327
328
329
</div>
{% endhighlight %}

330
    <h3 id="grid-responsive-resets">Responsive column resets</h3>
Ore Landau's avatar
Ore Landau committed
331
    <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 <a href="#responsive-utilities">responsive utility classes</a>.</p>
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<div class="bs-docs-grid">
  <div class="row show-grid">
    <div class="col-xs-6 col-sm-3">
      .col-xs-6 .col-sm-3
      <br>
      Resize your viewport or check it out on your phone for an example.
    </div>
    <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>

    <!-- Add the extra clearfix for only the required viewport -->
    <div class="clearfix visible-xs"></div>

    <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
    <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  </div>
</div>
348
349
350
351
352
353
354
355
356
357
358
359
{% highlight html %}
<div class="row">
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>

  <!-- Add the extra clearfix for only the required viewport -->
  <div class="clearfix visible-xs"></div>

  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
</div>
{% endhighlight %}
360
    <p>In addition to column clearing at responsive breakpoints, you may need to <strong>reset offsets, pushes, or pulls</strong>. Those resets are available for medium and large grid tiers only, since they start only at the (second) small grid tier. See this in action in <a href="../examples/grid/">the grid example</a>.</p>
361
362
363
364
365
366
367
368
369
370
371
372
{% highlight html %}
<div class="row">
  <div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
  <div class="col-sm-5 col-sm-offset-2 col-md-6 col-md-offset-0">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div>
</div>

<div class="row">
  <div class="col-sm-6 col-md-5 col-lg-6">.col-sm-6 .col-md-5 .col-lg-6</div>
  <div class="col-sm-6 col-md-5 col-md-offset-2 col-lg-6 col-lg-offset-0">.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0</div>
</div>
{% endhighlight %}

373

Mark Otto's avatar
Mark Otto committed
374
    <h3 id="grid-offsetting">Offsetting columns</h3>
375
    <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>
Mark Otto's avatar
Mark Otto committed
376
377
    <div class="bs-docs-grid">
      <div class="row show-grid">
378
379
380
        <div class="col-md-4">.col-md-4</div>
        <div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
      </div>
Mark Otto's avatar
Mark Otto committed
381
      <div class="row show-grid">
382
383
384
        <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
        <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
      </div>
Mark Otto's avatar
Mark Otto committed
385
      <div class="row show-grid">
386
387
        <div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
      </div>
Mark Otto's avatar
Mark Otto committed
388
389
390
    </div>
{% highlight html %}
<div class="row">
391
392
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
Mark Otto's avatar
Mark Otto committed
393
394
</div>
<div class="row">
395
396
  <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
  <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
Mark Otto's avatar
Mark Otto committed
397
398
</div>
<div class="row">
399
  <div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
Mark Otto's avatar
Mark Otto committed
400
401
402
403
404
</div>
{% endhighlight %}


    <h3 id="grid-nesting">Nesting columns</h3>
405
    <p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-md-*</code> columns within an existing <code>.col-md-*</code> column. Nested rows should include a set of columns that add up to 12 or less.</p>
Mark Otto's avatar
Mark Otto committed
406
    <div class="row show-grid">
407
      <div class="col-md-9">
408
        Level 1: .col-md-9
Mark Otto's avatar
Mark Otto committed
409
        <div class="row show-grid">
410
          <div class="col-md-6">
411
            Level 2: .col-md-6
Mark Otto's avatar
Mark Otto committed
412
          </div>
413
          <div class="col-md-6">
414
            Level 2: .col-md-6
Mark Otto's avatar
Mark Otto committed
415
416
417
418
419
420
          </div>
        </div>
      </div>
    </div>
{% highlight html %}
<div class="row">
421
  <div class="col-md-9">
422
    Level 1: .col-md-9
Mark Otto's avatar
Mark Otto committed
423
    <div class="row">
424
      <div class="col-md-6">
425
        Level 2: .col-md-6
Mark Otto's avatar
Mark Otto committed
426
      </div>
427
      <div class="col-md-6">
428
        Level 2: .col-md-6
Mark Otto's avatar
Mark Otto committed
429
430
431
432
433
434
435
      </div>
    </div>
  </div>
</div>
{% endhighlight %}

    <h3 id="grid-column-ordering">Column ordering</h3>
436
    <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>
Mark Otto's avatar
Mark Otto committed
437
    <div class="row show-grid">
438
439
      <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
      <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
Mark Otto's avatar
Mark Otto committed
440
441
442
    </div>

{% highlight html %}
443
<div class="row">
444
445
  <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
  <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
Mark Otto's avatar
Mark Otto committed
446
447
448
</div>
{% endhighlight %}

449
450
    <h3 id="grid-less">Less mixins and variables</h3>
    <p>In addition to <a href="#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>
Mark Otto's avatar
Mark Otto committed
451
452
453
454
455
456
457
458
459
460
461
462
463

    <h4>Variables</h4>
    <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 css %}
@grid-columns:              12;
@grid-gutter-width:         30px;
@grid-float-breakpoint:     768px;
{% endhighlight %}

    <h4>Mixins</h4>
    <p>Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.</p>
{% highlight css %}
// Creates a wrapper for a series of columns
464
.make-row(@gutter: @grid-gutter-width) {
Mark Otto's avatar
Mark Otto committed
465
466
  // Then clear the floated columns
  .clearfix();
467

Chris Rebert's avatar
Chris Rebert committed
468
  @media (min-width: @screen-sm-min) {
469
470
471
472
473
474
475
476
477
    margin-left:  (@gutter / -2);
    margin-right: (@gutter / -2);
  }

  // Negative margin nested rows out to align the content of columns
  .row {
    margin-left:  (@gutter / -2);
    margin-right: (@gutter / -2);
  }
Mark Otto's avatar
Mark Otto committed
478
479
}

480
481
// Generate the extra small columns
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
482
483
484
485
486
487
488
489
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
Mark Otto's avatar
Mark Otto committed
490
491
  @media (min-width: @grid-float-breakpoint) {
    float: left;
492
    width: percentage((@columns / @grid-columns));
Mark Otto's avatar
Mark Otto committed
493
494
495
  }
}

496
497
498
499
500
501
502
503
504
505
// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
Chris Rebert's avatar
Chris Rebert committed
506
  @media (min-width: @screen-sm-min) {
507
508
509
510
511
512
513
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the small column offsets
.make-sm-column-offset(@columns) {
Chris Rebert's avatar
Chris Rebert committed
514
  @media (min-width: @screen-sm-min) {
Mark Otto's avatar
Mark Otto committed
515
516
517
    margin-left: percentage((@columns / @grid-columns));
  }
}
518
.make-sm-column-push(@columns) {
Chris Rebert's avatar
Chris Rebert committed
519
  @media (min-width: @screen-sm-min) {
520
521
522
    left: percentage((@columns / @grid-columns));
  }
}
523
.make-sm-column-pull(@columns) {
Chris Rebert's avatar
Chris Rebert committed
524
  @media (min-width: @screen-sm-min) {
525
526
527
528
    right: percentage((@columns / @grid-columns));
  }
}

529
530
531
532
533
534
535
536
537
538
// Generate the medium columns
.make-md-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
Chris Rebert's avatar
Chris Rebert committed
539
  @media (min-width: @screen-md-min) {
540
541
542
543
544
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

545
// Generate the medium column offsets
546
.make-md-column-offset(@columns) {
Chris Rebert's avatar
Chris Rebert committed
547
  @media (min-width: @screen-md-min) {
548
549
550
551
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-md-column-push(@columns) {
Chris Rebert's avatar
Chris Rebert committed
552
  @media (min-width: @screen-md-min) {
553
554
555
556
    left: percentage((@columns / @grid-columns));
  }
}
.make-md-column-pull(@columns) {
Chris Rebert's avatar
Chris Rebert committed
557
  @media (min-width: @screen-md-min) {
558
559
560
561
562
563
    right: percentage((@columns / @grid-columns));
  }
}

// Generate the large columns
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
564
565
566
567
568
569
570
571
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
Chris Rebert's avatar
Chris Rebert committed
572
  @media (min-width: @screen-lg-min) {
573
    float: left;
574
575
576
    width: percentage((@columns / @grid-columns));
  }
}
577
578
579

// Generate the large column offsets
.make-lg-column-offset(@columns) {
Chris Rebert's avatar
Chris Rebert committed
580
  @media (min-width: @screen-lg-min) {
581
582
583
584
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-lg-column-push(@columns) {
Chris Rebert's avatar
Chris Rebert committed
585
  @media (min-width: @screen-lg-min) {
586
587
588
589
    left: percentage((@columns / @grid-columns));
  }
}
.make-lg-column-pull(@columns) {
Chris Rebert's avatar
Chris Rebert committed
590
  @media (min-width: @screen-lg-min) {
591
592
593
    right: percentage((@columns / @grid-columns));
  }
}
Mark Otto's avatar
Mark Otto committed
594
595
596
597
598
599
600
601
602
{% endhighlight %}

    <h4>Example usage</h4>
    <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>
{% highlight css %}
.wrapper {
  .make-row();
}
.content-main {
603
  .make-lg-column(8);
Mark Otto's avatar
Mark Otto committed
604
605
}
.content-secondary {
606
607
  .make-lg-column(3);
  .make-lg-column-offset(1);
Mark Otto's avatar
Mark Otto committed
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
}
{% endhighlight %}
{% highlight html %}
<div class="wrapper">
  <div class="content-main">...</div>
  <div class="content-secondary">...</div>
</div>
{% endhighlight %}

  </div>




  <!-- Typography
  ================================================== -->
Mark Otto's avatar
Mark Otto committed
624
  <div class="bs-docs-section">
Mark Otto's avatar
Mark Otto committed
625
    <div class="page-header">
Mark Otto's avatar
Mark Otto committed
626
      <h1 id="type">Typography</h1>
Mark Otto's avatar
Mark Otto committed
627
628
629
630
    </div>

    <!-- Headings -->
    <h2 id="type-headings">Headings</h2>
631
    <p>All HTML headings, <code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code>, are available. <code>.h1</code> through <code>.h6</code> classes are also available, for when you want to match the font styling of a heading but still want your text to be displayed inline.</p>
Mark Otto's avatar
Mark Otto committed
632
    <div class="bs-example bs-example-type">
Mark Otto's avatar
Mark Otto committed
633
634
635
      <table class="table">
        <tbody>
          <tr>
Mark Otto's avatar
Mark Otto committed
636
            <td><h1>h1. Bootstrap heading</h1></td>
Mark Otto's avatar
Mark Otto committed
637
            <td class="type-info">Semibold 36px</td>
Mark Otto's avatar
Mark Otto committed
638
639
          </tr>
          <tr>
Mark Otto's avatar
Mark Otto committed
640
            <td><h2>h2. Bootstrap heading</h2></td>
Mark Otto's avatar
Mark Otto committed
641
            <td class="type-info">Semibold 30px</td>
Mark Otto's avatar
Mark Otto committed
642
643
          </tr>
          <tr>
Mark Otto's avatar
Mark Otto committed
644
            <td><h3>h3. Bootstrap heading</h3></td>
Mark Otto's avatar
Mark Otto committed
645
            <td class="type-info">Semibold 24px</td>
Mark Otto's avatar
Mark Otto committed
646
647
          </tr>
          <tr>
Mark Otto's avatar
Mark Otto committed
648
            <td><h4>h4. Bootstrap heading</h4></td>
Mark Otto's avatar
Mark Otto committed
649
            <td class="type-info">Semibold 18px</td>
Mark Otto's avatar
Mark Otto committed
650
651
          </tr>
          <tr>
Mark Otto's avatar
Mark Otto committed
652
            <td><h5>h5. Bootstrap heading</h5></td>
Mark Otto's avatar
Mark Otto committed
653
            <td class="type-info">Semibold 14px</td>
Mark Otto's avatar
Mark Otto committed
654
655
          </tr>
          <tr>
Mark Otto's avatar
Mark Otto committed
656
            <td><h6>h6. Bootstrap heading</h6></td>
Mark Otto's avatar
Mark Otto committed
657
            <td class="type-info">Semibold 12px</td>
Mark Otto's avatar
Mark Otto committed
658
659
660
661
662
          </tr>
        </tbody>
      </table>
    </div>
{% highlight html %}
663
664
665
666
667
668
<h1>h1. Bootstrap heading</h1>
<h2>h2. Bootstrap heading</h2>
<h3>h3. Bootstrap heading</h3>
<h4>h4. Bootstrap heading</h4>
<h5>h5. Bootstrap heading</h5>
<h6>h6. Bootstrap heading</h6>
Mark Otto's avatar
Mark Otto committed
669
670
{% endhighlight %}

Mark Otto's avatar
Mark Otto committed
671
    <p>Create lighter, secondary text in any heading with a generic <code>&lt;small&gt;</code> tag or the <code>.small</code> class.</p>
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
    <div class="bs-example bs-example-type">
      <table class="table">
        <tbody>
          <tr>
            <td><h1>h1. Bootstrap heading <small>Secondary text</small></h1></td>
          </tr>
          <tr>
            <td><h2>h2. Bootstrap heading <small>Secondary text</small></h2></td>
          </tr>
          <tr>
            <td><h3>h3. Bootstrap heading <small>Secondary text</small></h3></td>
          </tr>
          <tr>
            <td><h4>h4. Bootstrap heading <small>Secondary text</small></h4></td>
          </tr>
          <tr>
            <td><h5>h5. Bootstrap heading <small>Secondary text</small></h5></td>
          </tr>
          <tr>
            <td><h6>h6. Bootstrap heading <small>Secondary text</small></h6></td>
          </tr>
        </tbody>
      </table>
    </div>
{% highlight html %}
<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
<h2>h2. Bootstrap heading <small>Secondary text</small></h2>
<h3>h3. Bootstrap heading <small>Secondary text</small></h3>
<h4>h4. Bootstrap heading <small>Secondary text</small></h4>
<h5>h5. Bootstrap heading <small>Secondary text</small></h5>
<h6>h6. Bootstrap heading <small>Secondary text</small></h6>
{% endhighlight %}


Mark Otto's avatar
Mark Otto committed
706
707
    <!-- Body copy -->
    <h2 id="type-body-copy">Body copy</h2>
Mark Otto's avatar
Mark Otto committed
708
    <p>Bootstrap's global default <code>font-size</code> is <strong>14px</strong>, with a <code>line-height</code> of <strong>1.428</strong>. This is applied to the <code>&lt;body&gt;</code> and all paragraphs. In addition, <code>&lt;p&gt;</code> (paragraphs) receive a bottom margin of half their computed line-height (10px by default).</p>
Mark Otto's avatar
Mark Otto committed
709
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
710
711
712
713
714
715
716
717
718
719
720
      <p>Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.</p>
      <p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.</p>
      <p>Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
    </div>
{% highlight html %}
<p>...</p>
{% endhighlight %}

    <!-- Body copy .lead -->
    <h3>Lead body copy</h3>
    <p>Make a paragraph stand out by adding <code>.lead</code>.</p>
Mark Otto's avatar
Mark Otto committed
721
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
722
723
724
725
726
727
      <p class="lead">Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.</p>
    </div>
{% highlight html %}
<p class="lead">...</p>
{% endhighlight %}

728
    <!-- Using Less -->
Mark Otto's avatar
Mark Otto committed
729
    <h3>Built with Less</h3>
730
    <p>The typographic scale is based on two Less variables in <strong>variables.less</strong>: <code>@font-size-base</code> and <code>@line-height-base</code>. The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.</p>
Mark Otto's avatar
Mark Otto committed
731
732
733
734
735
736
737
738


    <!-- Emphasis -->
    <h2 id="type-emphasis">Emphasis</h2>
    <p>Make use of HTML's default emphasis tags with lightweight styles.</p>

    <h3>Small text</h3>
    <p>For de-emphasizing inline or blocks of text, use the <code>&lt;small&gt;</code> tag to set text at 85% the size of the parent. Heading elements receive their own <code>font-size</code> for nested <code>&lt;small&gt;</code> elements.</p>
Mark Otto's avatar
Mark Otto committed
739
    <p>You may alternatively use an inline element with <code>.small</code> in place of any <code>&lt;small&gt;</code></p>
Mark Otto's avatar
Mark Otto committed
740
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
741
742
743
744
745
746
747
748
749
      <p><small>This line of text is meant to be treated as fine print.</small></p>
    </div>
{% highlight html %}
<small>This line of text is meant to be treated as fine print.</small>
{% endhighlight %}


    <h3>Bold</h3>
    <p>For emphasizing a snippet of text with a heavier font-weight.</p>
Mark Otto's avatar
Mark Otto committed
750
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
751
752
753
754
755
756
757
758
      <p>The following snippet of text is <strong>rendered as bold text</strong>.</p>
    </div>
{% highlight html %}
<strong>rendered as bold text</strong>
{% endhighlight %}

    <h3>Italics</h3>
    <p>For emphasizing a snippet of text with italics.</p>
Mark Otto's avatar
Mark Otto committed
759
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
760
761
762
763
764
765
      <p>The following snippet of text is <em>rendered as italicized text</em>.</p>
    </div>
{% highlight html %}
<em>rendered as italicized text</em>
{% endhighlight %}

766
767
768
769
    <div class="bs-callout bs-callout-info">
      <h4>Alternate elements</h4>
      <p>Feel free to use <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> in HTML5. <code>&lt;b&gt;</code> is meant to highlight words or phrases without conveying additional importance while <code>&lt;i&gt;</code> is mostly for voice, technical terms, etc.</p>
    </div>
Mark Otto's avatar
Mark Otto committed
770
771
772

    <h3>Alignment classes</h3>
    <p>Easily realign text to components with text alignment classes.</p>
Mark Otto's avatar
Mark Otto committed
773
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
      <p class="text-left">Left aligned text.</p>
      <p class="text-center">Center aligned text.</p>
      <p class="text-right">Right aligned text.</p>
    </div>
{% highlight html %}
<p class="text-left">Left aligned text.</p>
<p class="text-center">Center aligned text.</p>
<p class="text-right">Right aligned text.</p>
{% endhighlight %}


    <!-- Abbreviations -->
    <h2 id="type-abbreviations">Abbreviations</h2>
    <p>Stylized implementation of HTML's <code>&lt;abbr&gt;</code> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a <code>title</code> attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover.</p>

    <h3>Basic abbreviation</h3>
    <p>For expanded text on long hover of an abbreviation, include the <code>title</code> attribute with the <code>&lt;abbr&gt;</code> element.</p>
Mark Otto's avatar
Mark Otto committed
791
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
792
793
794
795
796
797
798
799
      <p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p>
    </div>
{% highlight html %}
<abbr title="attribute">attr</abbr>
{% endhighlight %}

    <h3>Initialism</h3>
    <p>Add <code>.initialism</code> to an abbreviation for a slightly smaller font-size.</p>
Mark Otto's avatar
Mark Otto committed
800
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
801
802
803
804
805
806
807
808
809
810
      <p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr> is the best thing since sliced bread.</p>
    </div>
{% highlight html %}
<abbr title="HyperText Markup Language" class="initialism">HTML</abbr>
{% endhighlight %}


    <!-- Addresses -->
    <h2 id="type-addresses">Addresses</h2>
    <p>Present contact information for the nearest ancestor or the entire body of work. Preserve formatting by ending all lines with <code>&lt;br&gt;</code>.</p>
Mark Otto's avatar
Mark Otto committed
811
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
      <address>
        <strong>Twitter, Inc.</strong><br>
        795 Folsom Ave, Suite 600<br>
        San Francisco, CA 94107<br>
        <abbr title="Phone">P:</abbr> (123) 456-7890
      </address>
      <address>
        <strong>Full Name</strong><br>
        <a href="mailto:#">first.last@example.com</a>
      </address>
    </div>
{% highlight html %}
<address>
  <strong>Twitter, Inc.</strong><br>
  795 Folsom Ave, Suite 600<br>
  San Francisco, CA 94107<br>
  <abbr title="Phone">P:</abbr> (123) 456-7890
</address>

<address>
  <strong>Full Name</strong><br>
  <a href="mailto:#">first.last@example.com</a>
</address>
{% endhighlight %}


    <!-- Blockquotes -->
    <h2 id="type-blockquotes">Blockquotes</h2>
    <p>For quoting blocks of content from another source within your document.</p>

    <h3>Default blockquote</h3>
Chris Rebert's avatar
Chris Rebert committed
843
    <p>Wrap <code>&lt;blockquote&gt;</code> around any <abbr title="HyperText Markup Language">HTML</abbr> as the quote. For straight quotes, we recommend a <code>&lt;p&gt;</code>.</p>
Mark Otto's avatar
Mark Otto committed
844
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
845
846
847
848
849
850
851
852
853
854
855
      <blockquote>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      </blockquote>
    </div>
{% highlight html %}
<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
</blockquote>
{% endhighlight %}

    <h3>Blockquote options</h3>
Chris Rebert's avatar
Chris Rebert committed
856
    <p>Style and content changes for simple variations on a standard <code>&lt;blockquote&gt;</code>.</p>
Mark Otto's avatar
Mark Otto committed
857
858

    <h4>Naming a source</h4>
859
    <p>Add a <code>&lt;footer&gt;</code> for identifying the source. Wrap the name of the source work in <code>&lt;cite&gt;</code>.</p>
Mark Otto's avatar
Mark Otto committed
860
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
861
862
      <blockquote>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
863
        <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
Mark Otto's avatar
Mark Otto committed
864
865
866
867
868
      </blockquote>
    </div>
{% highlight html %}
<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
869
  <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
Mark Otto's avatar
Mark Otto committed
870
871
872
873
</blockquote>
{% endhighlight %}

    <h4>Alternate displays</h4>
874
    <p>Add <code>.blockquote-reverse</code> for blockquote with right-aligned content.</p>
Mark Otto's avatar
Mark Otto committed
875
    <div class="bs-example" style="overflow: hidden;">
876
      <blockquote class="blockquote-reverse">
Mark Otto's avatar
Mark Otto committed
877
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
878
        <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
Mark Otto's avatar
Mark Otto committed
879
880
881
      </blockquote>
    </div>
{% highlight html %}
882
<blockquote class="blockquote-reverse">
Mark Otto's avatar
Mark Otto committed
883
884
885
886
887
888
889
890
891
892
  ...
</blockquote>
{% endhighlight %}


    <!-- Lists -->
    <h2 id="type-lists">Lists</h2>

    <h3>Unordered</h3>
    <p>A list of items in which the order does <em>not</em> explicitly matter.</p>
Mark Otto's avatar
Mark Otto committed
893
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
      <ul>
        <li>Lorem ipsum dolor sit amet</li>
        <li>Consectetur adipiscing elit</li>
        <li>Integer molestie lorem at massa</li>
        <li>Facilisis in pretium nisl aliquet</li>
        <li>Nulla volutpat aliquam velit
          <ul>
            <li>Phasellus iaculis neque</li>
            <li>Purus sodales ultricies</li>
            <li>Vestibulum laoreet porttitor sem</li>
            <li>Ac tristique libero volutpat at</li>
          </ul>
        </li>
        <li>Faucibus porta lacus fringilla vel</li>
        <li>Aenean sit amet erat nunc</li>
        <li>Eget porttitor lorem</li>
      </ul>
    </div>
{% highlight html %}
<ul>
  <li>...</li>
</ul>
{% endhighlight %}

    <h3>Ordered</h3>
    <p>A list of items in which the order <em>does</em> explicitly matter.</p>
Mark Otto's avatar
Mark Otto committed
920
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
      <ol>
        <li>Lorem ipsum dolor sit amet</li>
        <li>Consectetur adipiscing elit</li>
        <li>Integer molestie lorem at massa</li>
        <li>Facilisis in pretium nisl aliquet</li>
        <li>Nulla volutpat aliquam velit</li>
        <li>Faucibus porta lacus fringilla vel</li>
        <li>Aenean sit amet erat nunc</li>
        <li>Eget porttitor lorem</li>
      </ol>
    </div>
{% highlight html %}
<ol>
  <li>...</li>
</ol>
{% endhighlight %}

    <h3>Unstyled</h3>
    <p>Remove the default <code>list-style</code> and left margin on list items (immediate children only). <strong>This only applies to immediate children list items</strong>, meaning you will need to add the class for any nested lists as well.</p>
Mark Otto's avatar
Mark Otto committed
940
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
      <ul class="list-unstyled">
        <li>Lorem ipsum dolor sit amet</li>
        <li>Consectetur adipiscing elit</li>
        <li>Integer molestie lorem at massa</li>
        <li>Facilisis in pretium nisl aliquet</li>
        <li>Nulla volutpat aliquam velit
          <ul>
            <li>Phasellus iaculis neque</li>
            <li>Purus sodales ultricies</li>
            <li>Vestibulum laoreet porttitor sem</li>
            <li>Ac tristique libero volutpat at</li>
          </ul>
        </li>
        <li>Faucibus porta lacus fringilla vel</li>
        <li>Aenean sit amet erat nunc</li>
        <li>Eget porttitor lorem</li>
      </ul>
    </div>
{% highlight html %}
<ul class="list-unstyled">
  <li>...</li>
</ul>
{% endhighlight %}

    <h3>Inline</h3>
966
    <p>Place all list items on a single line with <code>display: inline-block;</code> and some light padding.</p>
Mark Otto's avatar
Mark Otto committed
967
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
968
969
970
971
972
973
974
975
976
977
978
979
980
981
      <ul class="list-inline">
        <li>Lorem ipsum</li>
        <li>Phasellus iaculis</li>
        <li>Nulla volutpat</li>
      </ul>
    </div>
{% highlight html %}
<ul class="list-inline">
  <li>...</li>
</ul>
{% endhighlight %}

    <h3>Description</h3>
    <p>A list of terms with their associated descriptions.</p>
Mark Otto's avatar
Mark Otto committed
982
    <div class="bs-example">
Mark Otto's avatar
Mark Otto committed
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
      <dl>
        <dt>Description lists</dt>
        <dd>A description list is perfect for defining terms.</dd>
        <dt>Euismod</dt>
        <dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.</dd>
        <dd>Donec id elit non mi porta gravida at eget metus.</dd>
        <dt>Malesuada porta</dt>
        <dd>Etiam porta sem malesuada magna mollis euismod.</dd>
      </dl>
    </div>
{% highlight html %}
<dl>
  <dt>...</dt>
  <dd>...</dd>
</dl>
{% endhighlight %}

    <h4>Horizontal description</h4>
For faster browsing, not all history is shown. View entire blame