base-css.mustache 62.4 KB
Newer Older
1
2
3
<!-- Masthead
================================================== -->
<header class="jumbotron subhead" id="overview">
4
5
  <h1>{{_i}}Base CSS{{/i}}</h1>
  <p class="lead">{{_i}}On top of the scaffolding, basic HTML elements are styled and enhanced with extensible classes to provide a fresh, consistent look and feel.{{/i}}</p>
6
</header>
7
8


9
10
11
12
13
14
15
16
17
18
19
20
21
22
<section id="contents">
  <div class="bs-docs-contents">
    <h3>{{_i}}Contents{{/i}}</h3>
    <ol>
      <li><a href="#typography">{{_i}}Typography{{/i}}</a></li>
      <li><a href="#code">{{_i}}Code{{/i}}</a></li>
      <li><a href="#tables">{{_i}}Tables{{/i}}</a></li>
      <li><a href="#forms">{{_i}}Forms{{/i}}</a></li>
      <li><a href="#buttons">{{_i}}Buttons{{/i}}</a></li>
      <li><a href="#icons">{{_i}}Icons by Glyphicons{{/i}}</a></li>
    </ol>
  </div>
</section>

23
24
25
26
<!-- Typography
================================================== -->
<section id="typography">
  <div class="page-header">
27
    <h1>{{_i}}Typography <small>Headings, paragraphs, lists, and other inline type elements</small>{{/i}}</h1>
28
29
  </div>

30
31
32
33
34
35
36
37
38
39
40
  {{! Headings }}
  <h2>{{_i}}Headings{{/i}}</h2>
  <p>{{_i}}All HTML headings, <code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code> are available.{{/i}}</p>
  <div class="bs-docs-example">
    <h1>h1. {{_i}}Heading 1{{/i}}</h1>
    <h2>h2. {{_i}}Heading 2{{/i}}</h2>
    <h3>h3. {{_i}}Heading 3{{/i}}</h3>
    <h4>h4. {{_i}}Heading 4{{/i}}</h4>
    <h5>h5. {{_i}}Heading 5{{/i}}</h5>
    <h6>h6. {{_i}}Heading 6{{/i}}</h6>
  </div>
41

42
43
44
45
46
47
48
  {{! Body copy }}
  <h2>{{_i}}Body copy{{/i}}</h2>
  <p>{{_i}}Bootstrap's global default <code>font-size</code> is <strong>13px</strong>, with a <code>line-height</code> of <strong>18px</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 line-height (9px by default).{{/i}}</p>
  <div class="bs-docs-example">
    <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>
49
50
  </div>

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  {{! Body copy .lead }}
  <h2>{{_i}}Lead body copy{{/i}}</h2>
  <p>{{_i}}Make a paragraph stand out by adding <code>.lead</code>.{{/i}}</p>
  <div class="bs-docs-example">
    <p class="lead">Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.</p>
  </div>

  {{! Using LESS }}
  <h2>{{_i}}Built with Less{{/i}}</h2>
  <p>{{_i}}The typographic scale is based on two Less variables in variables.less file: <code>@baseFontSize</code> and <code>@baseLineHeight</code>. The first is the base font-size used throughout and the second is the base line-height.{{/i}}</p>
  <p>{{_i}}We use those variables, and some math, to create the margins, paddings, and line-heights of all our type and more. Customize them and watch Bootstrap adapt as you go.{{/i}}</p>

  <hr>

  {{! Misc Elements }}
66
  <h2>{{_i}}Emphasis, address, and abbreviation{{/i}}</h2>
67
68
69
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
70
71
72
        <th>{{_i}}Element{{/i}}</th>
        <th>{{_i}}Usage{{/i}}</th>
        <th>{{_i}}Optional{{/i}}</th>
73
74
75
76
77
78
79
80
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
          <code>&lt;strong&gt;</code>
        </td>
        <td>
81
          {{_i}}For emphasizing a snippet of text with <strong>important</strong>{{/i}}
82
83
        </td>
        <td>
84
          <span class="muted">{{_i}}None{{/i}}</span>
85
86
87
88
89
90
91
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;em&gt;</code>
        </td>
        <td>
92
          {{_i}}For emphasizing a snippet of text with <em>stress</em>{{/i}}
93
94
        </td>
        <td>
95
          <span class="muted">{{_i}}None{{/i}}</span>
96
97
98
99
100
101
102
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;abbr&gt;</code>
        </td>
        <td>
103
          {{_i}}Wraps abbreviations and acronyms to show the expanded version on hover{{/i}}
104
105
        </td>
        <td>
106
107
          <p>{{_i}}Include optional <code>title</code> attribute for expanded text{{/i}}</p>
          {{_i}}Use <code>.initialism</code> class for uppercase abbreviations.{{/i}}
108
109
110
111
112
113
114
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;address&gt;</code>
        </td>
        <td>
115
          {{_i}}For contact information for its nearest ancestor or the entire body of work{{/i}}
116
117
        </td>
        <td>
118
          {{_i}}Preserve formatting by ending all lines with <code>&lt;br&gt;</code>{{/i}}
119
120
121
122
123
        </td>
      </tr>
    </tbody>
  </table>

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
  {{! Emphasis }}
  <h3>{{_i}}Using emphasis{{/i}}</h3>
  <div class="bs-docs-example">
    <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>
  </div>
  <p>{{_i}}<strong>Note:</strong> 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.{{/i}}</p>

  {{! Addresses }}
  <h3>{{_i}}Example addresses{{/i}}</h3>
  <p>{{_i}}Here are two examples of how the <code>&lt;address&gt;</code> tag can be used:{{/i}}</p>
  <div class="bs-docs-example">
    <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>{{_i}}Full Name{{/i}}</strong><br>
      <a href="mailto:#">{{_i}}first.last@gmail.com{{/i}}</a>
    </address>
145
146
  </div>

147
148
149
150
151
152
153
154
155
156
157
158
  {{! Abbreviations }}
  <h3>{{_i}}Example abbreviations{{/i}}</h3>
  <p>{{_i}}Abbreviations with a <code>title</code> attribute have a light dotted bottom border and a help cursor on hover. This gives users extra indication something will be shown on hover.{{/i}}</p>
  <div class="bs-docs-example">
    <p>{{_i}}An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.{{/i}}</p>
  </div>
  <p>{{_i}}Add the <code>initialism</code> class to an abbreviation for a slightly smaller font-size.{{/i}}</p>
  <div class="bs-docs-example">
    <p>{{_i}}<abbr title="HyperText Markup Language" class="initialism">HTML</abbr> is the best thing since sliced bread.{{/i}}</p>
  </div>

  <hr>
159

160
  {{! Blockquotes }}
161
  <h2>{{_i}}Blockquotes{{/i}}</h2>
162
163
164
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
165
166
167
        <th>{{_i}}Element{{/i}}</th>
        <th>{{_i}}Usage{{/i}}</th>
        <th>{{_i}}Optional{{/i}}</th>
168
169
170
171
172
173
174
175
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
          <code>&lt;blockquote&gt;</code>
        </td>
        <td>
176
          {{_i}}Block-level element for quoting content from another source{{/i}}
177
178
        </td>
        <td>
179
180
          <p>{{_i}}Add <code>cite</code> attribute for source URL{{/i}}</p>
          {{_i}}Use <code>.pull-left</code> and <code>.pull-right</code> classes for floated options{{/i}}
181
182
183
184
185
186
187
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;small&gt;</code>
        </td>
        <td>
188
          {{_i}}Optional element for adding a user-facing citation, typically an author with title of work{{/i}}
189
190
        </td>
        <td>
191
          {{_i}}Place the <code>&lt;cite&gt;</code> around the title or name of source{{/i}}
192
193
194
195
        </td>
      </tr>
    </tbody>
  </table>
196
197
  <p>{{_i}}To include a blockquote, 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>.{{/i}}</p>
  <p>{{_i}}Include an optional <code>&lt;small&gt;</code> element to cite your source and you'll get an em dash <code>&amp;mdash;</code> before it for styling purposes.{{/i}}</p>
198
199
200
<pre class="prettyprint linenums">
&lt;blockquote&gt;
  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.&lt;/p&gt;
201
  &lt;small&gt;{{_i}}Someone famous{{/i}}&lt;/small&gt;
202
203
&lt;/blockquote&gt;
</pre>
204
  <h3>{{_i}}Example blockquotes{{/i}}</h3>
205
206
207
208
209
210
211
212
213
214
215
216
217
  <p>{{_i}}Default blockquotes are styled as such:{{/i}}</p>
  <div class="bs-docs-example">
    <blockquote>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p>
      <small>{{_i}}Someone famous in <cite title="">Body of work</cite>{{/i}}</small>
    </blockquote>
  </div>
  <p>{{_i}}To float your blockquote to the right, add <code>class="pull-right"</code>:{{/i}}</p>
  <div class="bs-docs-example">
    <blockquote class="pull-right">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p>
      <small>{{_i}}Someone famous in <cite title="">Body of work</cite>{{/i}}</small>
    </blockquote>
218
219
  </div>

220
  <hr>
221
222

  <!-- Lists -->
223
  <h2>{{_i}}Lists{{/i}}</h2>
224
225

  <h3>{{_i}}Unordered{{/i}}</h3>
226
  <p>{{_i}}A list of items in which the order does <em>not</em> explicitly matter.{{/i}}</p>
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
  <div class="bs-docs-example">
    <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>
<pre class="prettyprint linenums">
&lt;ul&gt;
  &lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
</pre>

  <h3>{{_i}}Ordered{{/i}}</h3>
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
  <p>{{_i}}A list of items in which the order <em>does</em> explicitly matter.{{/i}}</p>
  <div class="bs-docs-example">
    <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>
<pre class="prettyprint linenums">
&lt;ol&gt;
  &lt;li&gt;...&lt;/li&gt;
&lt;/ol&gt;
</pre>

  <h3>{{_i}}Unstyled{{/i}}</h3>
  <p>{{_i}}A list of items with no <code>list-style</code> or additional left padding.{{/i}}</p>
  <div class="bs-docs-example">
    <ul class="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>
<pre class="prettyprint linenums">
&lt;ul class="unstyled"&gt;
  &lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
</pre>
298
299

  <h3>{{_i}}Description{{/i}}</h3>
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
  <p>{{_i}}A list of terms with their associated descriptions.{{/i}}</p>
  <div class="bs-docs-example">
    <dl>
      <dt>{{_i}}Description lists{{/i}}</dt>
      <dd>{{_i}}A description list is perfect for defining terms.{{/i}}</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>
<pre class="prettyprint linenums">
&lt;dl&gt;
  &lt;dt&gt;...&lt;/dt&gt;
  &lt;dd&gt;...&lt;/dd&gt;
&lt;/dl&gt;
</pre>
318

319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
  <h4>{{_i}}Horizontal description{{/i}}</h4>
  <p>{{_i}}Make terms and descriptions in <code>&lt;dl&gt;</code> line up side-by-side.{{/i}}</p>
  <div class="bs-docs-example">
    <dl class="dl-horizontal">
      <dt>{{_i}}Description lists{{/i}}</dt>
      <dd>{{_i}}A description list is perfect for defining terms.{{/i}}</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>
      <dt>Felis euismod semper eget lacinia</dt>
      <dd>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</dd>
    </dl>
  </div>
<pre class="prettyprint linenums">
&lt;dl class="dl-horizontal"&gt;
  &lt;dt&gt;...&lt;/dt&gt;
  &lt;dd&gt;...&lt;/dd&gt;
&lt;/dl&gt;
</pre>
340
341
342
343
344
  <hr>
  <p>
    <span class="label label-info">{{_i}}Heads up!{{/i}}</span>
    {{_i}}Horizontal description lists will truncate terms that are too long to fit in the left column fix <code>text-overflow</code>. In narrower viewports, they will change to the default stacked layout.{{/i}}
  </p>
345
</section>
346
347
348



349
350
351
352
353
354
<!-- Code
================================================== -->
<section id="code">
  <div class="page-header">
    <h1>{{_i}}Code{{/i}} <small>{{_i}}Inline and block code snippets{{/i}}</small></h1>
  </div>
Mark Otto's avatar
Mark Otto committed
355
356
357

  <h2>Inline</h2>
  <p>Wrap inline snippets of code with <code>&lt;code&gt;</code>.</p>
358
359
360
<pre class="prettyprint linenums">
{{_i}}For example, &lt;code&gt;section&lt;/code&gt; should be wrapped as inline.{{/i}}
</pre>
Mark Otto's avatar
Mark Otto committed
361
362
363

  <h2>Basic block</h2>
  <p>{{_i}}Use <code>&lt;pre&gt;</code> for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.{{/i}}</p>
364
365
366
<pre>
&lt;p&gt;{{_i}}Sample text here...{{/i}}&lt;/p&gt;
</pre>
367
368
369
370
371
<pre class="prettyprint linenums" style="margin-bottom: 9px;">
&lt;pre&gt;
  &amp;lt;p&amp;gt;{{_i}}Sample text here...{{/i}}&amp;lt;/p&amp;gt;
&lt;/pre&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
372
373
374
375
376
  <p>{{_i}}<strong>Note:</strong> Be sure to keep code within <code>&lt;pre&gt;</code> tags as close to the left as possible; it will render all tabs.{{/i}}</p>
  <p>{{_i}}You may optionally add the <code>.pre-scrollable</code> class which will set a max-height of 350px and provide a y-axis scrollbar.{{/i}}</p>

  <h2>Google Prettify</h2>
  <p>Take the same <code>&lt;pre&gt;</code> element and add two optional classes for enhanced rendering.</p>
377
<pre class="prettyprint linenums" style="margin-bottom: 9px;">
378
379
380
&lt;p&gt;{{_i}}Sample text here...{{/i}}&lt;/p&gt;
</pre>
<pre class="prettyprint linenums" style="margin-bottom: 9px;">
381
382
383
384
385
&lt;pre class="prettyprint
     linenums"&gt;
  &amp;lt;p&amp;gt;{{_i}}Sample text here...{{/i}}&amp;lt;/p&amp;gt;
&lt;/pre&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
386
  <p>{{_i}}<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>.{{/i}}</p>
387
388
389
390
391
392
393
394
</section>



<!-- Tables
================================================== -->
<section id="tables">
  <div class="page-header">
395
    <h1>{{_i}}Tables <small>For, you guessed it, tabular data</small>{{/i}}</h1>
396
397
  </div>

398
  <h2>{{_i}}Table markup{{/i}}</h2>
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470

  <table class="table table-bordered table-striped">
    <colgroup>
      <col class="span1">
      <col class="span7">
    </colgroup>
    <thead>
      <tr>
        <th>{{_i}}Tag{{/i}}</th>
        <th>{{_i}}Description{{/i}}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
          <code>&lt;table&gt;</code>
        </td>
        <td>
          {{_i}}Wrapping element for displaying data in a tabular format{{/i}}
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;thead&gt;</code>
        </td>
        <td>
          {{_i}}Container element for table header rows (<code>&lt;tr&gt;</code>) to label table columns{{/i}}
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;tbody&gt;</code>
        </td>
        <td>
          {{_i}}Container element for table rows (<code>&lt;tr&gt;</code>) in the body of the table{{/i}}
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;tr&gt;</code>
        </td>
        <td>
          {{_i}}Container element for a set of table cells (<code>&lt;td&gt;</code> or <code>&lt;th&gt;</code>) that appears on a single row{{/i}}
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;td&gt;</code>
        </td>
        <td>
          {{_i}}Default table cell{{/i}}
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;th&gt;</code>
        </td>
        <td>
          {{_i}}Special table cell for column (or row, depending on scope and placement) labels{{/i}}<br>
          {{_i}}Must be used within a <code>&lt;thead&gt;</code>{{/i}}
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;caption&gt;</code>
        </td>
        <td>
          {{_i}}Description or summary of what the table holds, especially useful for screen readers{{/i}}
        </td>
      </tr>
    </tbody>
  </table>
471
472
473
474
<pre class="prettyprint linenums">
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
475
476
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
477
478
479
480
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
481
482
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
483
484
485
486
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</pre>
487

488

489
  <h2>{{_i}}Table options{{/i}}</h2>
490
491
492
  <table class="table table-bordered table-striped">
  <thead>
      <tr>
493
494
495
        <th>{{_i}}Name{{/i}}</th>
        <th>{{_i}}Class{{/i}}</th>
        <th>{{_i}}Description{{/i}}</th>
496
497
498
499
      </tr>
    </thead>
    <tbody>
      <tr>
500
501
502
        <td>{{_i}}Default{{/i}}</td>
        <td class="muted">{{_i}}None{{/i}}</td>
        <td>{{_i}}No styles, just columns and rows{{/i}}</td>
503
504
      </tr>
      <tr>
505
        <td>{{_i}}Basic{{/i}}</td>
506
507
508
        <td>
          <code>.table</code>
        </td>
509
        <td>{{_i}}Only horizontal lines between rows{{/i}}</td>
510
511
      </tr>
      <tr>
512
        <td>{{_i}}Bordered{{/i}}</td>
513
514
515
        <td>
          <code>.table-bordered</code>
        </td>
Kyle Robinson Young's avatar
Kyle Robinson Young committed
516
        <td>{{_i}}Rounds corners and adds outer border{{/i}}</td>
517
518
      </tr>
      <tr>
519
        <td>{{_i}}Zebra-stripe{{/i}}</td>
520
521
522
        <td>
          <code>.table-striped</code>
        </td>
523
        <td>{{_i}}Adds light gray background color to odd rows (1, 3, 5, etc){{/i}}</td>
524
525
      </tr>
      <tr>
526
        <td>{{_i}}Condensed{{/i}}</td>
527
528
529
        <td>
          <code>.table-condensed</code>
        </td>
530
        <td>{{_i}}Cuts vertical padding in half, from 8px to 4px, within all <code>td</code> and <code>th</code> elements{{/i}}</td>
531
532
533
534
535
      </tr>
    </tbody>
  </table>


536
  <h2>{{_i}}Example tables{{/i}}</h2>
537

538
  <h3>1. {{_i}}Default table styles{{/i}}</h3>
539
  <p>{{_i}}Tables are automatically styled with only a few borders to ensure readability and maintain structure. With 2.0, the <code>.table</code> class is required.{{/i}}</p>
540
541
<pre class="prettyprint linenums">
&lt;table class="table"&gt;
542

543
&lt;/table&gt;</pre>
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574

  <table class="table">
    <thead>
      <tr>
        <th>#</th>
        <th>{{_i}}First Name{{/i}}</th>
        <th>{{_i}}Last Name{{/i}}</th>
        <th>{{_i}}Username{{/i}}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>1</td>
        <td>Mark</td>
        <td>Otto</td>
        <td>@mdo</td>
      </tr>
      <tr>
        <td>2</td>
        <td>Jacob</td>
        <td>Thornton</td>
        <td>@fat</td>
      </tr>
      <tr>
        <td>3</td>
        <td>Larry</td>
        <td>the Bird</td>
        <td>@twitter</td>
      </tr>
    </tbody>
  </table>
575
576


577
  <h3>2. {{_i}}Striped table{{/i}}</h3>
578
579
  <p>{{_i}}Get a little fancy with your tables by adding zebra-striping&mdash;just add the <code>.table-striped</code> class.{{/i}}</p>
  <p class="muted">{{_i}}<strong>Note:</strong> Striped tables use the <code>:nth-child</code> CSS selector and is not available in IE7-IE8.{{/i}}</p>
580
581
<pre class="prettyprint linenums" style="margin-bottom: 18px;">
&lt;table class="table table-striped"&gt;
582

583
&lt;/table&gt;</pre>
584
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

  <table class="table table-striped">
    <thead>
      <tr>
        <th>#</th>
        <th>{{_i}}First Name{{/i}}</th>
        <th>{{_i}}Last Name{{/i}}</th>
        <th>{{_i}}Username{{/i}}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>1</td>
        <td>Mark</td>
        <td>Otto</td>
        <td>@mdo</td>
      </tr>
      <tr>
        <td>2</td>
        <td>Jacob</td>
        <td>Thornton</td>
        <td>@fat</td>
      </tr>
      <tr>
        <td>3</td>
        <td>Larry</td>
        <td>the Bird</td>
        <td>@twitter</td>
      </tr>
    </tbody>
  </table>
615
616


617
  <h3>3. {{_i}}Bordered table{{/i}}</h3>
618
  <p>{{_i}}Add borders around the entire table and rounded corners for aesthetic purposes.{{/i}}</p>
619
620
<pre class="prettyprint linenums">
&lt;table class="table table-bordered"&gt;
621

622
623
&lt;/table&gt;</pre>

624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
  <table class="table table-bordered">
    <thead>
      <tr>
        <th>#</th>
        <th>{{_i}}First Name{{/i}}</th>
        <th>{{_i}}Last Name{{/i}}</th>
        <th>{{_i}}Username{{/i}}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td rowspan="2">1</td>
        <td>Mark</td>
        <td>Otto</td>
        <td>@mdo</td>
      </tr>
      <tr>
        <td>Mark</td>
        <td>Otto</td>
        <td>@TwBootstrap</td>
      </tr>
      <tr>
        <td>2</td>
        <td>Jacob</td>
        <td>Thornton</td>
        <td>@fat</td>
      </tr>
      <tr>
        <td>3</td>
        <td colspan="2">Larry the Bird</td>
        <td>@twitter</td>
      </tr>
    </tbody>
  </table>
658

659
  <h3>4. {{_i}}Condensed table{{/i}}</h3>
660
  <p>{{_i}}Make your tables more compact by adding the <code>.table-condensed</code> class to cut table cell padding in half (from 8px to 4px).{{/i}}</p>
661
662
<pre class="prettyprint linenums" style="margin-bottom: 18px;">
&lt;table class="table table-condensed"&gt;
663

664
&lt;/table&gt;</pre>
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
  <table class="table table-condensed">
    <thead>
      <tr>
        <th>#</th>
        <th>{{_i}}First Name{{/i}}</th>
        <th>{{_i}}Last Name{{/i}}</th>
        <th>{{_i}}Username{{/i}}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>1</td>
        <td>Mark</td>
        <td>Otto</td>
        <td>@mdo</td>
      </tr>
      <tr>
        <td>2</td>
        <td>Jacob</td>
        <td>Thornton</td>
        <td>@fat</td>
      </tr>
      <tr>
        <td>3</td>
        <td colspan="2">Larry the Bird</td>
        <td>@twitter</td>
      </tr>
    </tbody>
  </table>
694
695


Mark Otto's avatar
Mark Otto committed
696
  <h3>5. {{_i}}Combine them all!{{/i}}</h3>
697
  <p>{{_i}}Feel free to combine any of the table classes to achieve different looks by utilizing any of the available classes.{{/i}}</p>
Mark Otto's avatar
Mark Otto committed
698
699
700
<pre class="prettyprint linenums" style="margin-bottom: 18px;">
&lt;table class="table table-striped table-bordered table-condensed"&gt;
  ...
701
&lt;/table&gt;</pre>
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
  <table class="table table-striped table-bordered table-condensed">
    <thead>
      <tr>
        <th></th>
        <th colspan="2">{{_i}}Full name{{/i}}</th>
        <th></th>
      </tr>
      <tr>
        <th>#</th>
        <th>{{_i}}First Name{{/i}}</th>
        <th>{{_i}}Last Name{{/i}}</th>
        <th>{{_i}}Username{{/i}}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
      <tr>
        <td>1</td>
        <td>Mark</td>
        <td>Otto</td>
        <td>@mdo</td>
      </tr>
      <tr>
        <td>2</td>
        <td>Jacob</td>
        <td>Thornton</td>
        <td>@fat</td>
      </tr>
      <tr>
        <td>3</td>
        <td colspan="2">Larry the Bird</td>
        <td>@twitter</td>
      </tr>
    </tbody>
  </table>
737
738
739
740
741
742
743
744
</section>



<!-- Forms
================================================== -->
<section id="forms">
  <div class="page-header">
745
    <h1>{{_i}}Forms{{/i}}</h1>
746
  </div>
Mark Otto's avatar
Mark Otto committed
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765

  <h2>{{_i}}Flexible HTML and CSS{{/i}}</h2>
  <p>{{_i}}The best part about forms in Bootstrap is that all your inputs and controls look great no matter how you build them in your markup. No superfluous HTML is required, but we provide the patterns for those who require it.{{/i}}</p>
  <p>{{_i}}More complicated layouts come with succinct and scalable classes for easy styling and event binding, so you're covered at every step.{{/i}}</p>

  <h2>{{_i}}Four layouts included{{/i}}</h2>
  <p>{{_i}}Bootstrap comes with support for four types of form layouts:{{/i}}</p>
  <ul>
    <li>{{_i}}Vertical (default){{/i}}</li>
    <li>{{_i}}Search{{/i}}</li>
    <li>{{_i}}Inline{{/i}}</li>
    <li>{{_i}}Horizontal{{/i}}</li>
  </ul>
  <p>{{_i}}Different types of form layouts require some changes to markup, but the controls themselves remain and behave the same.{{/i}}</p>

  <h2>{{_i}}Control states and more{{/i}}</h2>
  <p>{{_i}}Bootstrap's forms include styles for all the base form controls like input, textarea, and select you'd expect. But it also comes with a number of custom components like appended and prepended inputs and support for lists of checkboxes.{{/i}}</p>
  <p>{{_i}}States like error, warning, and success are included for each type of form control. Also included are styles for disabled controls.{{/i}}</p>

766

767
768
  <h2>{{_i}}Four types of forms{{/i}}</h2>
  <p>{{_i}}Bootstrap provides simple markup and styles for four styles of common web forms.{{/i}}</p>
769
770
771
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
772
773
774
        <th>{{_i}}Name{{/i}}</th>
        <th>{{_i}}Class{{/i}}</th>
        <th>{{_i}}Description{{/i}}</th>
775
776
777
778
      </tr>
    </thead>
    <tbody>
      <tr>
779
        <th>{{_i}}Vertical (default){{/i}}</th>
780
        <td><code>.form-vertical</code> <span class="muted">({{_i}}not required{{/i}})</span></td>
781
        <td>{{_i}}Stacked, left-aligned labels over controls{{/i}}</td>
782
783
      </tr>
      <tr>
784
        <th>{{_i}}Inline{{/i}}</th>
785
        <td><code>.form-inline</code></td>
786
        <td>{{_i}}Left-aligned label and inline-block controls for compact style{{/i}}</td>
787
788
      </tr>
      <tr>
789
        <th>{{_i}}Search{{/i}}</th>
790
        <td><code>.form-search</code></td>
791
        <td>{{_i}}Extra-rounded text input for a typical search aesthetic{{/i}}</td>
792
      </tr>
793
794
795
796
797
      <tr>
        <th>{{_i}}Horizontal{{/i}}</th>
        <td><code>.form-horizontal</code></td>
        <td>{{_i}}Float left, right-aligned labels on same line as controls{{/i}}</td>
      </tr>
798
799
800
801
    </tbody>
  </table>


802
  <h2>{{_i}}Example forms <small>using just form controls, no extra markup</small>{{/i}}</h2>
Mark Otto's avatar
Mark Otto committed
803
804
805
806
807
808
809
810
811
812
813
  <h3>{{_i}}Basic form{{/i}}</h3>
  <p>{{_i}}Smart and lightweight defaults without extra markup.{{/i}}</p>
  <form class="well">
    <label>{{_i}}Label name{{/i}}</label>
    <input type="text" class="span3" placeholder="{{_i}}Type something…{{/i}}">
    <p class="help-block">{{_i}}Example block-level help text here.{{/i}}</p>
    <label class="checkbox">
      <input type="checkbox"> {{_i}}Check me out{{/i}}
    </label>
    <button type="submit" class="btn">{{_i}}Submit{{/i}}</button>
  </form>
814
815
816
817
<pre class="prettyprint linenums">
&lt;form class="well"&gt;
  &lt;label&gt;{{_i}}Label name{{/i}}&lt;/label&gt;
  &lt;input type="text" class="span3" placeholder="{{_i}}Type something…{{/i}}"&gt;
818
  &lt;span class="help-block"&gt;Example block-level help text here.&lt;/span&gt;
819
820
821
822
823
824
  &lt;label class="checkbox"&gt;
    &lt;input type="checkbox"&gt; {{_i}}Check me out{{/i}}
  &lt;/label&gt;
  &lt;button type="submit" class="btn"&gt;{{_i}}Submit{{/i}}&lt;/button&gt;
&lt;/form&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
825
826
827
828
829
830
831

  <h3>{{_i}}Search form{{/i}}</h3>
  <p>{{_i}}Add <code>.form-search</code> to the form and <code>.search-query</code> to the <code>input</code>.{{/i}}</p>
  <form class="well form-search">
    <input type="text" class="input-medium search-query">
    <button type="submit" class="btn">{{_i}}Search{{/i}}</button>
  </form>
832
833
834
835
836
837
<pre class="prettyprint linenums">
&lt;form class="well form-search"&gt;
  &lt;input type="text" class="input-medium search-query"&gt;
  &lt;button type="submit" class="btn"&gt;{{_i}}Search{{/i}}&lt;/button&gt;
&lt;/form&gt;
</pre>
838

Mark Otto's avatar
Mark Otto committed
839
840
841
842
843
844
845
846
847
848
  <h3>{{_i}}Inline form{{/i}}</h3>
  <p>{{_i}}Add <code>.form-inline</code> to finesse the vertical alignment and spacing of form controls.{{/i}}</p>
  <form class="well form-inline">
    <input type="text" class="input-small" placeholder="{{_i}}Email{{/i}}">
    <input type="password" class="input-small" placeholder="{{_i}}Password{{/i}}">
    <label class="checkbox">
      <input type="checkbox"> {{_i}}Remember me{{/i}}
    </label>
    <button type="submit" class="btn">{{_i}}Sign in{{/i}}</button>
  </form>
849
850
851
852
<pre class="prettyprint linenums">
&lt;form class="well form-inline"&gt;
  &lt;input type="text" class="input-small" placeholder="{{_i}}Email{{/i}}"&gt;
  &lt;input type="password" class="input-small" placeholder="{{_i}}Password{{/i}}"&gt;
853
854
855
  &lt;label class="checkbox"&gt;
    &lt;input type="checkbox"&gt; {{_i}}Remember me{{/i}}
  &lt;/label&gt;
856
  &lt;button type="submit" class="btn"&gt;{{_i}}Sign in{{/i}}&lt;/button&gt;
857
858
&lt;/form&gt;
</pre>
859
860
861

  <br>

862
  <h2>{{_i}}Horizontal forms{{/i}}</h2>
Mark Otto's avatar
Mark Otto committed
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
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
930
931
932
933
934
935
  <p>{{_i}}Shown on the right are all the default form controls we support. Here's the bulleted list:{{/i}}</p>
  <ul>
    <li>{{_i}}text inputs (text, password, email, etc){{/i}}</li>
    <li>{{_i}}checkbox{{/i}}</li>
    <li>{{_i}}radio{{/i}}</li>
    <li>{{_i}}select{{/i}}</li>
    <li>{{_i}}multiple select{{/i}}</li>
    <li>{{_i}}file input{{/i}}</li>
    <li>{{_i}}textarea{{/i}}</li>
  </ul>

  <form class="form-horizontal">
    <fieldset>
      <div class="control-group">
        <label class="control-label" for="input01">{{_i}}Text input{{/i}}</label>
        <div class="controls">
          <input type="text" class="input-xlarge" id="input01">
          <p class="help-block">{{_i}}In addition to freeform text, any HTML5 text-based input appears like so.{{/i}}</p>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="optionsCheckbox">{{_i}}Checkbox{{/i}}</label>
        <div class="controls">
          <label class="checkbox">
            <input type="checkbox" id="optionsCheckbox" value="option1">
            {{_i}}Option one is this and that&mdash;be sure to include why it's great{{/i}}
          </label>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="select01">{{_i}}Select list{{/i}}</label>
        <div class="controls">
          <select id="select01">
            <option>something</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
          </select>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="multiSelect">{{_i}}Multicon-select{{/i}}</label>
        <div class="controls">
          <select multiple="multiple" id="multiSelect">
            <option>1</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
          </select>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="fileInput">{{_i}}File input{{/i}}</label>
        <div class="controls">
          <input class="input-file" id="fileInput" type="file">
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="textarea">{{_i}}Textarea{{/i}}</label>
        <div class="controls">
          <textarea class="input-xlarge" id="textarea" rows="3"></textarea>
        </div>
      </div>
      <div class="form-actions">
        <button type="submit" class="btn btn-primary">{{_i}}Save changes{{/i}}</button>
        <button class="btn">{{_i}}Cancel{{/i}}</button>
      </div>
    </fieldset>
  </form>
  <h3>{{_i}}Example markup{{/i}}</h3>
  <p>{{_i}}Given the above example form layout, here's the markup associated with the first input and control group. The <code>.control-group</code>, <code>.control-label</code>, and <code>.controls</code> classes are all required for styling.{{/i}}</p>
936
937
938
939
940
941
942
943
944
945
946
947
948
949
<pre class="prettyprint linenums">
&lt;form class="form-horizontal"&gt;
  &lt;fieldset&gt;
    &lt;legend&gt;{{_i}}Legend text{{/i}}&lt;/legend&gt;
    &lt;div class="control-group"&gt;
      &lt;label class="control-label" for="input01"&gt;{{_i}}Text input{{/i}}&lt;/label&gt;
      &lt;div class="controls"&gt;
        &lt;input type="text" class="input-xlarge" id="input01"&gt;
        &lt;p class="help-block"&gt;{{_i}}Supporting help text{{/i}}&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/fieldset&gt;
&lt;/form&gt;
</pre>
950
951
952

  <br>

953
  <h2>{{_i}}Form control states{{/i}}</h2>
Mark Otto's avatar
Mark Otto committed
954
955
956
957
  <p>{{_i}}Bootstrap features styles for browser-supported focused and <code>disabled</code> states. We remove the default Webkit <code>outline</code> and apply a <code>box-shadow</code> in its place for <code>:focus</code>.{{/i}}</p>
  <hr>
  <h3>{{_i}}Form validation{{/i}}</h3>
  <p>{{_i}}It also includes validation styles for errors, warnings, and success. To use, add the error class to the surrounding <code>.control-group</code>.{{/i}}</p>
958
959
960
961
962
963
<pre class="prettyprint linenums">
&lt;fieldset
  class="control-group error"&gt;

&lt;/fieldset&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000

  <form class="form-horizontal">
    <fieldset>
      <div class="control-group">
        <label class="control-label" for="focusedInput">{{_i}}Focused input{{/i}}</label>
        <div class="controls">
          <input class="input-xlarge focused" id="focusedInput" type="text" value="{{_i}}This is focused…{{/i}}">
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">Uneditable input</label>
        <div class="controls">
          <span class="input-xlarge uneditable-input">Some value here</span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="disabledInput">{{_i}}Disabled input{{/i}}</label>
        <div class="controls">
          <input class="input-xlarge disabled" id="disabledInput" type="text" placeholder="{{_i}}Disabled input here…{{/i}}" disabled>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="optionsCheckbox2">{{_i}}Disabled checkbox{{/i}}</label>
        <div class="controls">
          <label class="checkbox">
            <input type="checkbox" id="optionsCheckbox2" value="option1" disabled>
            {{_i}}This is a disabled checkbox{{/i}}
          </label>
        </div>
      </div>
      <div class="control-group warning">
        <label class="control-label" for="inputWarning">{{_i}}Input with warning{{/i}}</label>
        <div class="controls">
          <input type="text" id="inputWarning">
          <span class="help-inline">{{_i}}Something may have gone wrong{{/i}}</span>
        </div>
      </div>
For faster browsing, not all history is shown. View entire blame