index.html 78 KB
Newer Older
1
2
3
4
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
5
    <title>Bootstrap, from Twitter</title>
6
7
    <meta name="description" content="">
    <meta name="author" content="">
8

9
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
10
11
12
13
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

14
    <!-- Le styles -->
15
    <link href="../bootstrap.css" rel="stylesheet">
Jacob Thornton's avatar
Jacob Thornton committed
16
    <link href="assets/css/docs.css" rel="stylesheet">
17
    <link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
18

19
    <!-- Le fav and touch icons -->
20
21
22
23
    <link rel="shortcut icon" type="image/x-icon" href="assets/ico/favicon.ico">
    <link rel="apple-touch-icon" href="assets/ico/bootstrap-apple-57x57.png">
    <link rel="apple-touch-icon" sizes="72x72" href="assets/ico/bootstrap-apple-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114" href="assets/ico/bootstrap-apple-114x114.png">
24
25
  </head>

26
  <body>
27

Mark Otto's avatar
Mark Otto committed
28
29
    <!-- Topbar
    ================================================== -->
30
31
    <div class="navbar navbar-fixed" data-scrollspy="scrollspy">
      <div class="navbar-inner">
Jacob Thornton's avatar
Jacob Thornton committed
32
        <div class="container">
33
          <a class="brand" href="#">Bootstrap</a>
34
          <ul class="nav">
Mark Otto's avatar
Mark Otto committed
35
            <li class="active"><a href="#overview">Overview</a></li>
Jacob Thornton's avatar
Jacob Thornton committed
36
            <li><a href="#about">About</a></li>
37
38
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-dropdown="true">Scaffolding</a>
39
40
41
              <ul class="dropdown-menu">
                <li><a href="#grid-system">Grid</a></li>
                <li><a href="#layouts">Layouts</a></li>
42
                <li><a href="#responsive">Resposive</a></li>
43
44
              </ul>
            </li>
45
46
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-dropdown="true">CSS</a>
47
48
49
50
51
52
              <ul class="dropdown-menu">
                <li><a href="#typography">Type</a></li>
                <li><a href="#tables">Tables</a></li>
                <li><a href="#forms">Forms</a></li>
              </ul>
            </li>
53
54
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-dropdown="true">Patterns</a>
55
56
              <ul class="dropdown-menu">
                <li><a href="#navigation">Navigation</a></li>
57
                <li><a href="#media">Media</a></li>
58
59
                <li><a href="#alerts">Alerts</a></li>
                <li><a href="#popovers">Popovers</a></li>
60
61
62
                <li><a href="#autocomplete">Autocomplete</a></li>
                <li><a href="#accordion">Accordion</a></li>
                <li><a href="#datepicker">Datepicker</a></li>
63
64
              </ul>
            </li>
65
            <li><a href="#javascript">Javascript</a></li>
66
            <li><a href="#less">Using Less</a></li>
Jacob Thornton's avatar
Jacob Thornton committed
67
68
          </ul>
        </div>
69
70
71
      </div>
    </div>

72
73
74
75
76
77
78
  <div class="container">

    <div id="overview">
      <!-- Masthead (blueprinty thing)
      ================================================== -->
      <header class="jumbotron masthead">
        <div class="inner">
79
80
81
82
83
84
85
86
87
88
89
90
          <div class="benefits pull-right">
            <h4>Feature highlights</h4>
            <ul>
              <li><span>&times;</span> Built on LESS</li>
              <li><span>&times;</span> Complete styleguide</li>
              <li><span>&times;</span> Fully responsive design</li>
              <li><span>&times;</span> Small footprint (7kb gzipped)</li>
              <li><span>&times;</span> Support for IE7 and up</li>
              <li><span>&times;</span> Custom jQuery plugins</li>
              <li><span>&times;</span> Dozens of components</li>
            </ul>
          </div>
91
92
          <h1>Bootstrap, from Twitter</h1>
          <p class="lead">Bootstrap is a frontend toolkit from Twitter designed to kickstart web development, complete with core HTML, CSS, and JS for grids, type, forms, navigation, and many more components.</p>
93
          <a href="#" class="btn primary btn-large">Download on GitHub</a>
94
95
        </div>
      </header>
96

97
98
99
      <!-- Quickstart options
      ================================================== -->
      <div class="quickstart" style="display: none;">
100
        <div class="row">
101
          <div class="span4">
102
103
104
            <h6>Hotlink the CSS</h6>
            <p>For the quickest and easiest start, just copy this snippet into your webpage.</p>
            <form>
105
              <textarea class="copy-code" rows="1">&lt;link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.min.css"></textarea>
106
107
            </form>
          </div>
108
          <div class="span4">
109
110
            <h6>Use it with Less</h6>
            <p>A fan of using Less? No problem, just clone the repo and add these lines:</p>
111
            <form>
Jacob Thornton's avatar
Jacob Thornton committed
112
              <textarea class="copy-code" rows="2">&lt;link rel="stylesheet/less" href="/path/to/bootstrap.less"&gt;
113
  &lt;script src="/path/to/less.js"&gt;&lt;/script&gt;</textarea>
114
115
            </form>
          </div>
116
          <div class="span4">
117
            <h6>Fork on GitHub</h6>
118
            <p>Download, fork, pull, file issues, and more with the official Bootstrap repo on Github.</p>
Jacob Thornton's avatar
Jacob Thornton committed
119
            <p><a target="_blank" href="https://github.com/twitter/bootstrap" class="btn primary">Bootstrap on GitHub &raquo;</a></p>
Mark Otto's avatar
Mark Otto committed
120
            <p class="current-version">Currently <a href="https://github.com/twitter/bootstrap/wiki/Changelog">v1.3.0</a></p>
121
          </div>
122
        </div><!-- /row -->
123
124
      </div>

125
126
127
128
129
130
131
132
133
134
135
      <!-- About Bootstrap
      ================================================== -->
      <div class="row">
        <div class="span4">
          <h2>Built for and by nerds</h2>
          <p>Engineers at Twitter have historically used almost any library they were familiar with to meet front-end requirements. Bootstrap began as an answer to the challenges that presented. With the help of many awesome folks, Bootstrap has grown significantly.</p>
          <p>Read more on <a href="https://dev.twitter.com/blog/bootstrap-twitter">dev.twitter.com &rsaquo;</a></p>
        </div>
        <div class="span4">
          <h2>Cross-everything</h2>
          <p>Bootstrap is tested and supported in major modern browsers like Chrome, Safari, Internet Explorer, and Firefox.</p>
136
          <img class="browser-support" src="assets/img/browsers.png" alt="Tested and supported in Chrome, Safari, Internet Explorer, and Firefox">
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
          <ul>
            <li>Latest Safari</li>
            <li>Latest Google Chrome</li>
            <li>Firefox 4+</li>
            <li>Internet Explorer 7+</li>
            <li>Opera 11</li>
          </ul>
        </div>
        <div class="span4">
          <h2>What's included</h2>
          <p>Bootstrap comes complete with compiled CSS, uncompiled, and example templates.</p>
          <ul>
            <li><span class="label">New in 1.3</span> <a href="./javascript.html">Javascript plugins</a></li>
            <li>All original .less files</li>
            <li>Fully <a href="../bootstrap.css">compiled</a> and <a href="../bootstrap.min.css">minified</a> CSS</li>
            <li>Complete styleguide documentation</li>
            <li>Three example pages with different layouts</li>
          </ul>
        </div>
      </div><!-- /row -->
157
158
159

      <h3>Quick-start examples</h3>
      <p>Need some quick templates? Check out these basic examples we've put together:</p>
160
161
162
163
164
165
166
167
168
169
170
      <ul class="media-grid">
        <li>
          <a href="../examples/hero.html"><img src="assets/img/example-diagram-01.png" alt="Simple three-column layout with hero unit"></a>
        </li>
        <li>
          <a href="../examples/fluid.html"><img src="assets/img/example-diagram-02.png" alt="Fluid layout with static sidebar"></a>
        </li>
        <li>
          <a href="../examples/container-app.html"><img src="assets/img/example-diagram-03.png" alt="Simple hanging container for apps"></a>
        </li>
      </ul>
171

172
173
174
175
176
177
178
179
180
181
182
183
184
<!--
      Quick links:
      GitHub
      Twitter
      Roadmap
      Changelog

      Authors:
      @mdo
      @fat

 -->

185
    </div><!-- /#overview -->
Mark Otto's avatar
Mark Otto committed
186
187
188
189


<!-- Grid system
================================================== -->
190
<section id="grid-system">
191
192
  <div class="page-header">
    <h1>Grid system <small>Rock the standard 940px or roll your own</small></h1>
193
  </div>
194
  <div class="row">
195
    <div class="span3">
196
197
198
      <h2>Default grid</h2>
      <p>The default grid system provided as part of Bootstrap is a 940px wide 16-column grid. It’s a flavor of the popular 960 grid system, but without the additional margin/padding on the left and right sides.</p>
    </div>
199
    <div class="span9">
200
201
      <h3>Example grid markup</h3>
      <p>As shown here, a basic layout can be created with two "columns," each spanning a number of the 16 foundational columns we defined as part of our grid system. See the examples below for more variations.</p>
202
<pre class="prettyprint linenums">
203
&lt;div class="row"&gt;
Mark Otto's avatar
Mark Otto committed
204
  &lt;div class="span6"&gt;
205
206
    ...
  &lt;/div&gt;
Mark Otto's avatar
Mark Otto committed
207
  &lt;div class="span10"&gt;
208
209
    ...
  &lt;/div&gt;
210
211
&lt;/div&gt;
</pre>
212
    </div>
213
  </div><!-- /row -->
214
  <div class="row show-grid">
215
216
217
218
219
220
221
222
223
224
225
226
    <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>
227
228
  </div>
  <div class="row show-grid">
Mark Otto's avatar
Mark Otto committed
229
230
231
    <div class="span4">4</div>
    <div class="span4">4</div>
    <div class="span4">4</div>
232
233
  </div>
  <div class="row show-grid">
Mark Otto's avatar
Mark Otto committed
234
    <div class="span4">4</div>
235
236
237
    <div class="span8">8</div>
  </div>
  <div class="row show-grid">
Mark Otto's avatar
Mark Otto committed
238
239
    <div class="span6">6</div>
    <div class="span6">6</div>
240
241
242
243
  </div>
  <div class="row show-grid">
    <div class="span12">12</div>
  </div>
244
245
246
247

  <br>

  <h2>Offsetting columns</h2>
248
  <div class="row show-grid">
Mark Otto's avatar
Mark Otto committed
249
    <div class="span4">4</div>
250
    <div class="span8 offset4">8 offset 4</div>
251
  </div><!-- /row -->
Mark Otto's avatar
Mark Otto committed
252
  <div class="row show-grid">
253
254
    <div class="span3 offset3">3 offset 3</div>
    <div class="span3 offset3">3 offset 3</div>
Mark Otto's avatar
Mark Otto committed
255
  </div><!-- /row -->
256
  <div class="row show-grid">
257
    <div class="span8 offset4">8 offset 4</div>
258
  </div><!-- /row -->
259

260
261
262
  <br>

  <div class="row">
263
    <div class="span3">
264
265
266
      <h2>Nesting columns</h2>
      <p>Nest your content if you must by creating a <code>.row</code> within an existing column.</p>
    </div>
267
    <div class="span9">
268
      <h4>Example of nested columns</h4>
269
      <div class="row show-grid">
270
        <div class="span9">
271
272
          Level 1 of column
          <div class="row show-grid">
273
            <div class="span4">
274
275
              Level 2
            </div>
276
            <div class="span5">
277
278
279
              Level 2
            </div>
          </div>
280
281
        </div>
      </div>
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<pre class="prettyprint linenums">
&lt;div class="row"&gt;
  &lt;div class="span12"&gt;
    Level 1 of column
    &lt;div class="row"&gt;
      &lt;div class="span6"&gt;
        Level 2
      &lt;/div&gt;
      &lt;div class="span6"&gt;
        Level 2
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
297
    </div>
298
299
300
301
302
  </div>

  <br>

  <div class="row">
303
    <div class="span3">
304
305
306
      <h2>Roll your own grid</h2>
      <p>Built into Bootstrap are a handful of variables for customizing the default 940px grid system. With a bit of customization, you can modify the size of columns, their gutters, and the container they reside in.</p>
    </div>
307
    <div class="span9">
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
      <h3>Inside the grid</h3>
      <p>The variables needed to modify the grid system currently all reside in <code>preboot.less</code>.</p>
      <table class="zebra-striped">
        <thead>
          <tr>
            <th>Variable</th>
            <th>Default value</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td><code>@gridColumns</code></td>
            <td>16</td>
            <td>The number of columns within the grid</td>
          </tr>
          <tr>
            <td><code>@gridColumnWidth</code></td>
            <td>40px</td>
            <td>The width of each column within the grid</td>
          </tr>
          <tr>
            <td><code>@gridGutterWidth</code></td>
            <td>20px</td>
            <td>The negative space between each column</td>
          </tr>
          <tr>
            <td><code>@siteWidth</code></td>
            <td><em>Computed sum of all columns and gutters</em></td>
            <td>We use some basic match to count the number of columns and gutters and set the width of the <code>.fixed-container()</code> mixin.</td>
          </tr>
        </tbody>
      </table>
341
342
343
      <h3>Now to customize</h3>
      <p>Modifying the grid means changing the three <code>@grid-*</code> variables and recompiling the Less files.</p>
      <p>Bootstrap comes equipped to handle a grid system with up to 24 columns; the default is just 16. Here's how your grid variables would look customized to a 24-column grid.</p>
344
      <pre class="prettyprint linenums">@gridColumns:       24;
345
346
347
@gridColumnWidth:   20px;
@gridGutterWidth:   20px;</pre>
      <p>Once recompiled, you'll be set!</p>
348
349
    </div>
  </div>
350
351
352
353
</section>



Mark Otto's avatar
Mark Otto committed
354
355
<!-- Layouts (Default and fluid)
================================================== -->
356
357
358
359
<section id="layouts">
  <div class="page-header">
    <h1>Layouts <small>Basic templates to create webpages</small></h1>
  </div>
Mark Otto's avatar
Mark Otto committed
360

361
  <div class="row">
362
    <div class="span6">
363
      <h2>Fixed layout</h2>
364
      <p>The default and simple 940px-wide, centered layout for just about any website or page provided by a single <code>&lt;div.container&gt;</code>.</p>
365
366
367
      <div class="mini-layout">
        <div class="mini-layout-body"></div>
      </div>
368
<pre class="prettyprint linenums">
369
370
371
372
373
374
&lt;body&gt;
  &lt;div class="container"&gt;
    ...
  &lt;/div&gt;
&lt;/body&gt;
</pre>
375
    </div><!-- /col -->
376
    <div class="span6">
377
      <h2>Fluid layout</h2>
378
      <p>An alternative, flexible fluid page structure with min- and max-widths and a left-hand sidebar. Great for apps and docs.</p>
379
380
381
382
      <div class="mini-layout fluid">
        <div class="mini-layout-sidebar"></div>
        <div class="mini-layout-body"></div>
      </div>
383
<pre class="prettyprint linenums">
384
385
386
387
388
389
390
391
392
393
394
&lt;body&gt;
  &lt;div class="container-fluid"&gt;
    &lt;div class="sidebar"&gt;
      ...
    &lt;/div&gt;
    &lt;div class="content"&gt;
      ...
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/body&gt;
</pre>
395
396
    </div><!-- /col -->
  </div><!-- /row -->
397
398
399
400
</section>



Mark Otto's avatar
Mark Otto committed
401
402
<!-- Typography
================================================== -->
403
<section id="typography">
Mark Otto's avatar
Mark Otto committed
404
405
  <div class="page-header">
    <h1>Typography <small>Headings, paragraphs, lists, and other inline type elements</small></h1>
406
  </div>
407

Mark Otto's avatar
Mark Otto committed
408
409
  <!-- Headings & Paragraph Copy -->
  <div class="row">
Mark Otto's avatar
Mark Otto committed
410
    <div class="span4">
411
      <h2>Headings &amp; copy</h2>
Mark Otto's avatar
Mark Otto committed
412
      <p>A standard typographic hierarchy for structuring your webpages.</p>
413
414
      <p>The entire typographic grid is based on two Less variables in our preboot.less file: <code>@basefont</code> and <code>@baseline</code>. The first is the base font-size used throughout and the second is the base line-height.</p>
      <p>We use those variables, and some math, to create the margins, paddings, and line-heights of all our type and more.</p>
Mark Otto's avatar
Mark Otto committed
415
    </div>
Mark Otto's avatar
Mark Otto committed
416
    <div class="span4">
Mark Otto's avatar
Mark Otto committed
417
418
419
420
421
422
423
      <h1>h1. Heading 1</h1>
      <h2>h2. Heading 2</h2>
      <h3>h3. Heading 3</h3>
      <h4>h4. Heading 4</h4>
      <h5>h5. Heading 5</h5>
      <h6>h6. Heading 6</h6>
    </div>
424
    <div class="span4">
Mark Otto's avatar
Mark Otto committed
425
426
427
428
      <h3>Example paragraph</h3>
      <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 ut id elit.</p>
      <h1>Example heading <small>Has sub-heading&hellip;</small></h1>
    </div>
429
430
  </div>

Mark Otto's avatar
Mark Otto committed
431
432
  <!-- Misc Elements -->
  <div class="row">
433
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
434
435
436
437
438
439
440
441
442
      <h2>Misc. elements</h2>
      <p>Using emphasis, addresses, &amp; abbreviations</p>
      <p>
        <code>&lt;strong&gt;</code>
        <code>&lt;em&gt;</code>
        <code>&lt;address&gt;</code>
        <code>&lt;abbr&gt;</code>
      </p>
    </div>
443
    <div class="span9">
444
      <h3>When to use</h3>
Mark Otto's avatar
Mark Otto committed
445
446
447
      <p>Emphasis tags (<code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code>) should be used to indicate additional importance or emphasis of a word or phrase relative to its surrounding copy. Use <code>&lt;strong&gt;</code> for importance and <code>&lt;em&gt;</code> for <em>stress</em> emphasis.</p>
      <h3>Emphasis in a paragraph</h3>
      <p><a href="#">Fusce dapibus</a>, <strong>tellus ac cursus commodo</strong>, <em>tortor mauris condimentum nibh</em>, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.</p>
448
      <p><strong>Note:</strong> It's still okay to use <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> tags in HTML5 and they don't have to be styled bold and italic, respectively (although if there is a more semantic element, use it). <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>
Mark Otto's avatar
Mark Otto committed
449
      <h3>Addresses</h3>
Mark Otto's avatar
Mark Otto committed
450
451
452
453
454
      <p>The <code>&lt;address&gt;</code> element is used for contact information for its nearest ancestor, or the entire body of work. Here are two examples of how it could be used:</p>

      <div class="row">
        <div class="span4">
          <address>
455
456
457
            <strong>Twitter, Inc.</strong><br>
            795 Folsom Ave, Suite 600<br>
            San Francisco, CA 94107<br>
Mark Otto's avatar
Mark Otto committed
458
459
460
461
462
            <abbr title="Phone">P:</abbr> (123) 456-7890
          </address>
        </div>
        <div class="span4">
          <address>
463
            <strong>Full Name</strong><br>
Mark Otto's avatar
Mark Otto committed
464
465
466
467
468
            <a mailto="">first.last@gmail.com</a>
          </address>
        </div>
      </div>

Mark Otto's avatar
Mark Otto committed
469
470
471
472
      <p><strong>Note:</strong> Each line in an <code>&lt;address&gt;</code> must end with a line-break (<code>&lt;br /&gt;</code>) or be wrapped in a block-level tag (e.g., <code>&lt;p&gt;</code>) to properly structure the content.</p>
      <h3>Abbreviations</h3>
      <p>For abbreviations and acronyms, use the <code>&lt;abbr&gt;</code> tag (<code>&lt;acronym&gt;</code> is deprecated in <abbr title="HyperText Markup Langugage 5">HTML5</abbr>). Put the shorthand form within the tag and set a title for the complete name.</p>
    </div>
473
  </div><!-- /row -->
474

Mark Otto's avatar
Mark Otto committed
475
476
  <!-- Blockquotes -->
  <div class="row">
477
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
478
479
480
481
482
483
484
      <h2>Blockquotes</h2>
      <p>
        <code>&lt;blockquote&gt;</code>
        <code>&lt;p&gt;</code>
        <code>&lt;small&gt;</code>
      </p>
    </div>
485
    <div class="span9">
486
      <h3>How to quote</h3>
Mark Otto's avatar
Mark Otto committed
487
      <p>To include a blockquote, wrap <code>&lt;blockquote&gt;</code> around <code>&lt;p&gt;</code> and <code>&lt;small&gt;</code> tags. Use the <code>&lt;small&gt;</code> element to cite your source and you'll get an em dash <code>&amp;mdash;</code> before it.</p>
Mark Otto's avatar
Mark Otto committed
488
      <blockquote>
Mark Otto's avatar
Mark Otto committed
489
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>
Mark Otto's avatar
Mark Otto committed
490
491
        <small>Dr. Julius Hibbert</small>
      </blockquote>
492
493
494
495
496
497
<pre class="prettyprint linenums">
&lt;blockquote&gt;
  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.&lt;/p&gt;
  &lt;small&gt;Dr. Julius Hibbert&lt;/small&gt;
&lt;/blockquote&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
498
    </div>
499
  </div><!-- /row -->
500

Mark Otto's avatar
Mark Otto committed
501
502
  <h2>Lists</h2>
  <div class="row">
503
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
504
505
      <h4>Unordered <code>&lt;ul&gt;</code></h4>
      <ul>
Mark Otto's avatar
Mark Otto committed
506
507
508
509
510
        <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
Mark Otto's avatar
Mark Otto committed
511
          <ul>
Mark Otto's avatar
Mark Otto committed
512
513
514
515
            <li>Phasellus iaculis neque</li>
            <li>Purus sodales ultricies</li>
            <li>Vestibulum laoreet porttitor sem</li>
            <li>Ac tristique libero volutpat at</li>
Mark Otto's avatar
Mark Otto committed
516
517
          </ul>
        </li>
Mark Otto's avatar
Mark Otto committed
518
519
520
        <li>Faucibus porta lacus fringilla vel</li>
        <li>Aenean sit amet erat nunc</li>
        <li>Eget porttitor lorem</li>
Mark Otto's avatar
Mark Otto committed
521
522
      </ul>
    </div>
523
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
524
525
      <h4>Unstyled <code>&lt;ul.unstyled&gt;</code></h4>
      <ul class="unstyled">
Mark Otto's avatar
Mark Otto committed
526
527
528
529
530
        <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
Mark Otto's avatar
Mark Otto committed
531
          <ul>
Mark Otto's avatar
Mark Otto committed
532
533
534
535
            <li>Phasellus iaculis neque</li>
            <li>Purus sodales ultricies</li>
            <li>Vestibulum laoreet porttitor sem</li>
            <li>Ac tristique libero volutpat at</li>
Mark Otto's avatar
Mark Otto committed
536
537
          </ul>
        </li>
Mark Otto's avatar
Mark Otto committed
538
539
540
        <li>Faucibus porta lacus fringilla vel</li>
        <li>Aenean sit amet erat nunc</li>
        <li>Eget porttitor lorem</li>
Mark Otto's avatar
Mark Otto committed
541
542
      </ul>
    </div>
543
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
544
545
      <h4>Ordered <code>&lt;ol&gt;</code></h4>
      <ol>
Mark Otto's avatar
Mark Otto committed
546
547
548
549
550
551
552
553
        <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>
Mark Otto's avatar
Mark Otto committed
554
555
      </ol>
    </div>
556
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
557
558
559
560
561
562
563
564
565
566
567
      <h4>Description <code>dl</code></h4>
      <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>
568
  </div><!-- /row -->
569
570
571
572


  <!-- Code -->
  <div class="row">
573
    <div class="span3">
574
575
576
577
578
579
580
      <h2>Code</h2>
      <p>
        <code>&lt;code&gt;</code>
        <code>&lt;pre&gt;</code>
      </p>
      <p>Pimp your code in style with two simple tags. For even more awesomeness through javascript, drop in Google's code prettify library and you're set.</p>
    </div>
581
    <div class="span9">
582
583
      <h3>Presenting code</h3>
      <p>Code, blocks of or just snippets inline, can be displayed with style just by wrapping in the right tag. For blocks of code spanning multiple lines, use the <code>&lt;pre&gt;</code> element. For inline code, use the <code>&lt;code&gt;</code> element.</p>
Mark Otto's avatar
Mark Otto committed
584
      <table class="zebra-striped">
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
        <thead>
          <tr>
            <th style="width: 190px;">Element</th>
            <th>Result</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td><code>&lt;code&gt;</code></td>
            <td>In a line of text like this, your wrapped code will look like this <code>&gt;html&lt;</code> element.</td>
          </tr>
          <tr>
            <td><code>&lt;pre&gt;</code></td>
            <td>
<pre>&lt;div&gt;
  &lt;h1&gt;Heading&lt;/h1&gt;
  &lt;p&gt;Something right here...&lt;/p&gt;
&lt;/div&gt;</pre>
              <p><strong>Note:</strong> Be sure to keep code within <code>pre</code> tags as close to the left as possible; it will render all tabs.</p>
            </td>
          </tr>
          <tr>
            <td><code>&lt;pre class="prettyprint"&gt;</code></td>
            <td>
              <p>Using the google-code-prettify library, you're blocks of code get a slightly different visual style and automatic syntax highlighting.</p>
<pre class="prettyprint">&lt;div&gt;
  &lt;h1&gt;Heading&lt;/h1&gt;
  &lt;p&gt;Something right here...&lt;/p&gt;
&lt;/div&gt;</pre>
              <p><a href="http://code.google.com/p/google-code-prettify/">Download google-code-prettify</a> and view the readme for <a href="http://google-code-prettify.googlecode.com/svn/trunk/README.html">how to use</a>.</p>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div><!-- /row -->

  <!-- Labels -->
  <div class="row">
624
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
625
      <h2>Inline labels</h2>
626
627
628
      <p>
        <code>&lt;span class="label"&gt;</code>
      </p>
629
      <p>Call attention to or flag any phrase in your body text.</p>
630
    </div>
631
    <div class="span9">
632
633
      <h3>Label anything</h3>
      <p>Ever needed one of those fancy <span class="label success">New!</span> or <span class="label important">Important</span> flags when writing code? Well, now you have them. Here's what's included by default:</p>
Mark Otto's avatar
Mark Otto committed
634
      <table class="zebra-striped">
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
        <thead>
          <tr>
            <th style="width: 50%;">Label</th>
            <th>Result</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>
              <code>&lt;span class="label"&gt;Default&lt;/span&gt;</code>
            </td>
            <td>
              <span class="label">Default</span>
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;span class="label success"&gt;New&lt;/span&gt;</code>
            </td>
            <td>
              <span class="label success">New</span>
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;span class="label warning"&gt;Warning&lt;/span&gt;</code>
            </td>
            <td>
              <span class="label warning">Warning</span>
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;span class="label important"&gt;Important&lt;/span&gt;</code>
            </td>
            <td>
              <span class="label important">Important</span>
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;span class="label notice"&gt;Notice&lt;/span&gt;</code>
            </td>
            <td>
              <span class="label notice">Notice</span>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div><!-- /row -->

687
688
689
690
</section>



Mark Otto's avatar
Mark Otto committed
691
692
<!-- Tables
================================================== -->
693
<section id="tables">
Mark Otto's avatar
Mark Otto committed
694
695
  <div class="page-header">
    <h1>Tables <small>For, you guessed it, tabular data</small></h1>
696
  </div>
Mark Otto's avatar
Mark Otto committed
697
698
  <!-- Table structure -->
  <div class="row">
699
    <div class="span3">
Mark Otto's avatar
Mark Otto committed
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
      <h2>Building tables</h2>
      <p>
        <code>&lt;table&gt;</code>
        <code>&lt;thead&gt;</code>
        <code>&lt;tbody&gt;</code>
        <code>&lt;tr&gt;</code>
        <code>&lt;th&gt;</code>
        <code>&lt;td&gt;</code>
        <code>&lt;colspan&gt;</code>
        <code>&lt;caption&gt;</code>
      </p>
      <p>Tables are great&mdash;for a lot of things. Great tables, however, need a bit of markup love to be useful, scalable, and readable (at the code level). Here are a few tips to help.</p>
      <p>Always wrap your column headers in a <code>&lt;thead&gt;</code> such that hierarchy is <code>&lt;thead&gt;</code> > <code>&lt;tr&gt;</code> > <code>&lt;th&gt;</code>.</p>
      <p>Similar to the column headers, all your table’s body content should be wrapped in a <code>&lt;tbody&gt;</code> so your hierarchy is <code>&lt;tbody&gt;</code> > <code>&lt;tr&gt;</code> > <code>&lt;td&gt;</code>.</p>
    </div>
715
    <div class="span9">
Mark Otto's avatar
Mark Otto committed
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
      <h3>Example: Default table styles</h3>
      <p>All tables will be automatically styled with only the essential borders to ensure readability and maintain structure. No need to add extra classes or attributes.</p>
      <table>
        <thead>
          <tr>
            <th>#</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Language</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Some</td>
            <td>One</td>
            <td>English</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Joe</td>
            <td>Sixpack</td>
            <td>English</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
            <td>Code</td>
          </tr>
        </tbody>
      </table>
748
<pre class="prettyprint linenums">
Mark Otto's avatar
Mark Otto committed
749
&lt;table&gt;
750
751
  ...
&lt;/table&gt;</pre>
Mark Otto's avatar
Mark Otto committed
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
      <h3>Example: Zebra-striped</h3>
      <p>Get a little fancy with your tables by adding zebra-striping&mdash;just add the <code>.zebra-striped</code> class.</p>
      <table class="zebra-striped">
        <thead>
          <tr>
            <th>#</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Language</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Some</td>
            <td>One</td>
            <td>English</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Joe</td>
            <td>Sixpack</td>
            <td>English</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
            <td>Code</td>
          </tr>
        </tbody>
      </table>
784
      <p><strong>Note:</strong> Zebra-striping is a progressive enhancement not available for older browsers like IE8 and below.</p>
785
<pre class="prettyprint linenums">
Mark Otto's avatar
Mark Otto committed
786
&lt;table class="zebra-striped"&gt;
787
788
...
&lt;/table&gt;</pre>
Mark Otto's avatar
Mark Otto committed
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
      <h3>Example: Zebra-striped w/ TableSorter.js</h3>
      <p>Taking the previous example, we improve the usefulness of our tables by providing sorting functionality via <a href="http://jquery.com">jQuery</a> and the <a href="http://tablesorter.com/docs/">Tablesorter</a> plugin. <strong>Click any column’s header to change the sort.</strong></p>
      <table class="zebra-striped" id="sortTableExample">
        <thead>
          <tr>
            <th>#</th>
            <th class="yellow">First Name</th>
            <th class="blue">Last Name</th>
            <th class="green">Language</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Your</td>
            <td>One</td>
            <td>English</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Joe</td>
            <td>Sixpack</td>
            <td>English</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
            <td>Code</td>
          </tr>
        </tbody>
      </table>
821
<pre class="prettyprint linenums">
Jacob Thornton's avatar
Jacob Thornton committed
822
823
824
825
&lt;script src="js/jquery/jquery.tablesorter.min.js"&gt;&lt;/script&gt;
&lt;script &gt;
  $(function() {
    $("table#sortTableExample").tablesorter({ sortList: [[1,0]] });
826
827
  });
&lt;/script&gt;
Mark Otto's avatar
Mark Otto committed
828
&lt;table class="zebra-striped"&gt;
829
830
  ...
&lt;/table&gt;</pre>
Mark Otto's avatar
Mark Otto committed
831
    </div>
832
  </div><!-- /row -->
833
834
835
836
</section>



Mark Otto's avatar
Mark Otto committed
837
838
<!-- Forms
================================================== -->
839
<section id="forms">
Mark Otto's avatar
Mark Otto committed
840
841
  <div class="page-header">
    <h1>Forms</h1>
842
  </div>
843
  <div class="row">
844
    <div class="span4">
845
846
847
848
849
850
851
852
853
      <h3>Four types of forms</h3>
      <p>With 2.0, we now have four types of forms to choose from:</p>
      <ul>
        <li>Search form for a super-rounded input and optional button</li>
        <li>Inline form for a series of elements on one line</li>
        <li>Horizontal form for left-aligned labels</li>
        <li>Vertical form for stacked labels and inputs</li>
      </ul>
    </div>
854
    <div class="span4">
855
856
      <h3></h3>
    </div>
857
  </div><!-- /row -->
Mark Otto's avatar
Mark Otto committed
858
  <div class="row">
859
    <div class="span3">
860
      <h2>Search form</h2>
Mark Otto's avatar
Mark Otto committed
861
    </div>
862
    <div class="span9">
863
864
865
866
867
868
      <div class="well">
        <form class="form-search">
          <input type="text" class="search-query">
          <button type="submit" class="btn">Search</button>
        </form>
      </div><!--/well-->
869
    </div>
870
  </div><!-- /row -->
Mark Otto's avatar
Mark Otto committed
871
  <div class="row">
872
    <div class="span3">
873
      <h2>Inline form</h2>
874
    </div>
875
    <div class="span9">
876
877
878
879
880
881
882
883
884
885
      <div class="well">
        <form class="form-inline">
          <h4>Some directional text</h4>
          <p>And maybe some kind of optional supporting text right here.</p>
          <input type="text" class="input-medium">
          <input type="text" class="input-medium">
          <input type="text" class="input-medium">
          <button type="submit" class="btn">Search</button>
        </form>
      </div><!--/well-->
886
    </div>
887
  </div><!-- /row -->
888
  <div class="row">
889
    <div class="span3">
890
      <h2>Horizontal form</h2>
891
    </div>
892
    <div class="span9">
893
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
920
921
922
923
924
925
926
927
928
929
      <form class="form-horizontal">
        <legend>Example form</legend>
        <fieldset class="control-group">
          <label class="control-label" for="input01">Text input</label>
          <div class="controls">
            <input type="text" class="xlarge" name="input01">
            <p class="help-text">Help text here. Be sure to fill this out like so, or else!</p>
          </div>
        </fieldset>
        <fieldset class="control-group">
          <label class="control-label" for="select01">Select list</label>
          <div class="controls">
            <select name="select01">
              <option>1</option>
              <option>2</option>
              <option>3</option>
              <option>4</option>
              <option>5</option>
            </select>
          </div>
        </fieldset>
        <fieldset class="control-group">
          <label class="control-label" for="multiSelect">Multi-select</label>
          <div class="controls">
            <select multiple="multiple" name="multiSelect">
              <option>1</option>
              <option>2</option>
              <option>3</option>
              <option>4</option>
              <option>5</option>
            </select>
          </div>
        </fieldset>
        <legend>Example form</legend>
        <fieldset class="control-group">
          <label class="control-label" for="fileInput">File input</label>
          <div class="controls">
930
            <input class="input-file" id="fileInput" name="fileInput" type="file">
931
932
933
934
935
936
937
938
939
940
941
          </div>
        </fieldset>
        <fieldset class="control-group has-error">
          <label class="control-label" for="inputError">Input with error</label>
          <div class="controls">
            <input type="text" name="inputError">
          </div>
        </fieldset>
        <fieldset class="control-group has-error">
          <label class="control-label" for="textareaError">Textarea with error</label>
          <div class="controls">
942
            <textarea class="input-xlarge" rows="3"></textarea>
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
          </div>
        </fieldset>
        <fieldset class="control-group">
          <label class="control-label" for="optionsCheckboxes">Checkboxes</label>
          <div class="controls">
            <div class="control-list">
              <label class="checkbox">
                <input type="checkbox" name="optionsCheckboxes" value="option1">
                Option one is this and that&mdash;be sure to include why it’s great
              </label>
              <label class="checkbox">
                <input type="checkbox" name="optionsCheckboxes" value="option2">
                Option two can also be checked and included in form results
              </label>
              <label class="checkbox">
                <input type="checkbox" name="optionsCheckboxes" value="option3">
                Option three can&mdash;yes, you guessed it&mdash;also be checked and included in form results
              </label>
              <label class="checkbox">
                <input type="checkbox" name="optionsCheckboxes" value="option4">
                Option four cannot be checked as it is disabled
              </label>
            </div>
            <p class="help-text"><strong>Note:</strong> Labels surround all the options for much larger click areas and a more usable form.</p>
          </div>
        </fieldset>
        <fieldset class="control-group">
          <label class="control-label" for="optionsRadios">Radio buttons</label>
          <div class="controls">
            <div class="control-list">
              <label>
974
                <input type="radio" checked name="optionsRadios" value="option1">
975
976
977
                <span>Option one is this and that&mdash;be sure to include why it’s great</span>
              </label>
              <label>
978
                <input type="radio" name="optionsRadios" value="option2">
979
980
981
982
983
984
985
986
987
988
                <span>Option two can is something else and selecting it will deselect options 1</span>
              </label>
            </div>
            <p class="help-text"><strong>Note:</strong> Labels surround all the options for much larger click areas and a more usable form.</p>
          </div>
        </fieldset>
        <fieldset class="form-actions">
          <button type="submit" class="btn primary">Save changes</button>
          <button type="reset" class="btn">Cancel</button>
        </fieldset>
989
990
      </form>
    </div>
991
  </div><!-- /row -->
Mark Otto's avatar
Mark Otto committed
992
  <div class="row">
993
    <div class="span3">
994
      <h2>Vertical form</h2>
995
    </div>
996
    <div class="span9">
997
998
999
1000
      <form class="form-vertical">
        <legend>Example form</legend>
        <fieldset class="control-group">
          <label class="control-label" for="input01">Label</label>
For faster browsing, not all history is shown. View entire blame