base-css.mustache 50.8 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>
Mark Otto's avatar
Mark Otto committed
6
7
  <div class="subnav">
    <ul class="nav pills">
8
9
10
11
12
      <li><a href="#typography">{{_i}}Typography{{/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>
Mark Otto's avatar
Mark Otto committed
13
14
    </ul>
  </div>
15
16
17
18
19
20
21
</header>


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

25
  <h2>{{_i}}Headings &amp; body copy{{/i}}</h2>
26
27
28
29

  <!-- Headings & Paragraph Copy -->
  <div class="row">
    <div class="span4">
30
31
32
      <h3>{{_i}}Typographic scale{{/i}}</h3>
      <p>{{_i}}The entire typographic grid is based on two Less variables in our preboot.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.{{/i}}</p>
33
34
    </div>
    <div class="span4">
35
      <h3>{{_i}}Example body text{{/i}}</h3>
36
37
38
39
40
      <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>
      <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec sed odio dui.</p>
    </div>
    <div class="span4">
      <div class="well">
41
42
43
44
45
46
        <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>
47
48
49
50
51
      </div>
    </div>
  </div>

  <!-- Misc Elements -->
52
  <h2>{{_i}}Emphasis, address, and abbreviation{{/i}}</h2>
53
54
55
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
56
57
58
        <th>{{_i}}Element{{/i}}</th>
        <th>{{_i}}Usage{{/i}}</th>
        <th>{{_i}}Optional{{/i}}</th>
59
60
61
62
63
64
65
66
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
          <code>&lt;strong&gt;</code>
        </td>
        <td>
67
          {{_i}}For emphasizing a snippet of text with <strong>important</strong>{{/i}}
68
69
        </td>
        <td>
70
          <span class="muted">{{_i}}None{{/i}}</span>
71
72
73
74
75
76
77
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;em&gt;</code>
        </td>
        <td>
78
          {{_i}}For emphasizing a snippet of text with <em>stress</em>{{/i}}
79
80
        </td>
        <td>
81
          <span class="muted">{{_i}}None{{/i}}</span>
82
83
84
85
86
87
88
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;abbr&gt;</code>
        </td>
        <td>
89
          {{_i}}Wraps abbreviations and acronyms to show the expanded version on hover{{/i}}
90
91
        </td>
        <td>
92
          {{_i}}Include optional <code>title</code> for expanded text{{/i}}
93
94
95
96
97
98
99
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;address&gt;</code>
        </td>
        <td>
100
          {{_i}}For contact information for its nearest ancestor or the entire body of work{{/i}}
101
102
        </td>
        <td>
103
          {{_i}}Preserve formatting by ending all lines with <code>&lt;br&gt;</code>{{/i}}
104
105
106
107
108
109
110
        </td>
      </tr>
    </tbody>
  </table>

  <div class="row">
    <div class="span4">
111
      <h3>{{_i}}Using emphasis{{/i}}</h3>
112
      <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>
113
      <p>{{_i}}<strong>Note:</strong> Feel free to use <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> in HTML5, but their usage has changed a bit. <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>
114
115
    </div>
    <div class="span4">
116
117
      <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>
118
119
120
121
122
123
124
      <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>
125
        <strong>{{_i}}Full Name{{/i}}</strong><br>
Mark Otto's avatar
Mark Otto committed
126
        <a href="mailto:#">{{_i}}first.last@gmail.com{{/i}}</a>
127
128
129
      </address>
    </div>
    <div class="span4">
130
131
132
133
      <h3>{{_i}}Example abbreviations{{/i}}</h3>
      <p>{{_i}}Abbreviations are styled with uppercase text and a light dotted bottom border. They also have a help cursor on hover so users have extra indication something will be shown on hover.{{/i}}</p>
      <p>{{_i}}<abbr title="HyperText Markup Language">HTML</abbr> is the best thing since sliced bread.{{/i}}</p>
      <p>{{_i}}An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.{{/i}}</p>
134
135
136
137
138
    </div>
  </div>


  <!-- Blockquotes -->
139
  <h2>{{_i}}Blockquotes{{/i}}</h2>
140
141
142
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
143
144
145
        <th>{{_i}}Element{{/i}}</th>
        <th>{{_i}}Usage{{/i}}</th>
        <th>{{_i}}Optional{{/i}}</th>
146
147
148
149
150
151
152
153
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
          <code>&lt;blockquote&gt;</code>
        </td>
        <td>
154
          {{_i}}Block-level element for quoting content from another source{{/i}}
155
156
        </td>
        <td>
157
158
          <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}}
159
160
161
162
163
164
165
        </td>
      </tr>
      <tr>
        <td>
          <code>&lt;small&gt;</code>
        </td>
        <td>
166
          {{_i}}Optional element for adding a user-facing citation, typically an author with title of work{{/i}}
167
168
        </td>
        <td>
169
          {{_i}}Place the <code>&lt;cite&gt;</code> around the title or name of source{{/i}}
170
171
172
173
174
175
        </td>
      </tr>
    </tbody>
  </table>
  <div class="row">
    <div class="span4">
176
177
      <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>
178
179
180
181
182
    </div>
    <div class="span8">
<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;
183
  &lt;small&gt;{{_i}}Someone famous{{/i}}&lt;/small&gt;
184
185
186
187
188
&lt;/blockquote&gt;
</pre>
    </div>
  </div><!--/row-->

189
  <h3>{{_i}}Example blockquotes{{/i}}</h3>
190
191
  <div class="row">
    <div class="span6">
192
      <p>{{_i}}Default blockquotes are styled as such:{{/i}}</p>
193
194
      <blockquote>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p>
195
        <small>{{_i}}Someone famous in <cite title="">Body of work</cite>{{/i}}</small>
196
197
198
      </blockquote>
    </div>
    <div class="span6">
199
      <p>{{_i}}To float your blockquote to the right, add <code>class="pull-right"</code>:{{/i}}</p>
200
201
      <blockquote class="pull-right">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p>
202
        <small>{{_i}}Someone famous in <cite title="">Body of work</cite>{{/i}}</small>
203
204
205
206
207
208
      </blockquote>
    </div>
  </div>


  <!-- Lists -->
209
  <h2>{{_i}}Lists{{/i}}</h2>
210
211
  <div class="row">
    <div class="span3">
212
      <h4>{{_i}}Unordered{{/i}}</h4>
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
      <p><code>&lt;ul&gt;</code></p>
      <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>
    <div class="span3">
233
      <h4>{{_i}}Unstyled{{/i}}</h4>
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
      <p><code>&lt;ul class="unstyled"&gt;</code></p>
      <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>
    <div class="span3">
254
      <h4>{{_i}}Ordered{{/i}}</h4>
255
256
257
258
259
260
261
262
263
264
265
266
267
      <p><code>&lt;ol&gt;</code></p>
      <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>
    <div class="span3">
268
      <h4>{{_i}}Description{{/i}}</h4>
269
270
      <p><code>&lt;dl&gt;</code></p>
      <dl>
271
272
        <dt>{{_i}}Description lists{{/i}}</dt>
        <dd>{{_i}}A description list is perfect for defining terms.{{/i}}</dd>
273
274
275
276
277
278
279
280
281
282
283
284
        <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>
  </div><!-- /row -->


  <!-- Code -->

285
  <h2>{{_i}}Code <small>Inline and block</small>{{/i}}</h2>
286
287
288
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
289
290
        <th style="width: 190px;">{{_i}}Element{{/i}}</th>
        <th>{{_i}}Result{{/i}}</th>
291
292
293
294
295
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>&lt;code&gt;</code></td>
296
        <td>{{_i}}In a line of text like this, your wrapped code will look like this <code>&lt;html&gt;</code> element.{{/i}}</td>
297
298
299
300
301
      </tr>
      <tr>
        <td><code>&lt;pre&gt;</code></td>
        <td>
<pre>&lt;div&gt;
302
303
  &lt;h1&gt;{{_i}}Heading{{/i}}&lt;/h1&gt;
  &lt;p&gt;{{_i}}Something right here…{{/i}}&lt;/p&gt;
304
&lt;/div&gt;</pre>
305
          <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>
306
307
308
309
310
        </td>
      </tr>
      <tr>
        <td><code>&lt;pre class="prettyprint"&gt;</code></td>
        <td>
311
          <p>{{_i}}Using the google-code-prettify library, your blocks of code get a slightly different visual style and automatic syntax highlighting. You can also add an additional class to add line numbers.{{/i}}</p>
312
<pre class="prettyprint">&lt;div&gt;
313
314
  &lt;h1&gt;{{_i}}Heading{{/i}}&lt;/h1&gt;
  &lt;p&gt;{{_i}}Something right here…{{/i}}&lt;/p&gt;
315
316
&lt;/div&gt;</pre>
<pre class="prettyprint linenums">&lt;div&gt;
317
318
  &lt;h1&gt;{{_i}}Heading{{/i}}&lt;/h1&gt;
  &lt;p&gt;{{_i}}Something right here…{{/i}}&lt;/p&gt;
319
&lt;/div&gt;</pre>
320
          <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>
321
322
323
324
325
326
        </td>
      </tr>
    </tbody>
  </table>

  <!-- Labels -->
327
  <h2>{{_i}}Inline labels <small>for special attention</small>{{/i}}</h2>
328
329
330
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
331
332
        <th style="width: 190px;">{{_i}}Labels{{/i}}</th>
        <th>{{_i}}Markup{{/i}}</th>
333
334
335
336
337
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
338
          <span class="label">{{_i}}Default{{/i}}</span>
339
340
        </td>
        <td>
341
          <code>&lt;span class="label"&gt;{{_i}}Default{{/i}}&lt;/span&gt;</code>
342
343
344
345
        </td>
      </tr>
      <tr>
        <td>
346
          <span class="label success">{{_i}}New{{/i}}</span>
347
348
        </td>
        <td>
349
          <code>&lt;span class="label success"&gt;{{/_i}}New{{/i}}&lt;/span&gt;</code>
350
351
352
353
        </td>
      </tr>
      <tr>
        <td>
354
          <span class="label warning">{{_i}}Warning{{/i}}</span>
355
356
        </td>
        <td>
357
          <code>&lt;span class="label warning"&gt;{{_i}}Warning{{/i}}&lt;/span&gt;</code>
358
359
360
361
        </td>
      </tr>
      <tr>
        <td>
362
          <span class="label important">{{_i}}Important{{/i}}</span>
363
364
        </td>
        <td>
365
          <code>&lt;span class="label important"&gt;{{_i}}Important{{/i}}&lt;/span&gt;</code>
366
367
368
369
        </td>
      </tr>
      <tr>
        <td>
370
          <span class="label notice">{{_i}}Notice{{/i}}</span>
371
372
        </td>
        <td>
373
          <code>&lt;span class="label notice"&gt;{{_i}}Notice{{/i}}&lt;/span&gt;</code>
374
375
376
377
378
379
380
381
382
383
384
385
386
        </td>
      </tr>
    </tbody>
  </table>

</section>



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

390
  <h2>{{_i}}Table markup{{/i}}</h2>
391
392
393
394
395
  <div class="row">
    <div class="span8">
      <table class="table table-bordered table-striped">
        <thead>
          <tr>
396
397
            <th>{{_i}}Tag{{/i}}</th>
            <th>{{_i}}Description{{/i}}</th>
398
399
400
401
402
403
404
405
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>
              <code>&lt;table&gt;</code>
            </td>
            <td>
406
              {{_i}}Wrapping element for displaying data in a tabular format{{/i}}
407
408
409
410
411
412
413
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;thead&gt;</code>
            </td>
            <td>
414
              {{_i}}Container element for table header rows (<code>&lt;tr&gt;</code>) to label table columns{{/i}}
415
416
417
418
419
420
421
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;tbody&gt;</code>
            </td>
            <td>
422
              {{_i}}Container element for table rows (<code>&lt;tr&gt;</code>) in the body of the table{{/i}}
423
424
425
426
427
428
429
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;tr&gt;</code>
            </td>
            <td>
430
              {{_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}}
431
432
433
434
435
436
437
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;td&gt;</code>
            </td>
            <td>
438
              {{_i}}Default table cell{{/i}}
439
440
441
442
443
444
445
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;th&gt;</code>
            </td>
            <td>
446
447
              {{_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}}
448
449
450
451
452
453
454
            </td>
          </tr>
          <tr>
            <td>
              <code>&lt;caption&gt;</code>
            </td>
            <td>
455
              {{_i}}Description or summary of what the table holds, especially useful for screen readers{{/i}}
456
457
458
459
460
461
462
463
464
465
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="span4">
<pre class="prettyprint linenums">
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
466
467
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
468
469
470
471
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
472
473
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
474
475
476
477
478
479
480
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</pre>
    </div>
  </div>

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


528
  <h2>{{_i}}Example tables{{/i}}</h2>
529

530
  <h3>1. {{_i}}Default table styles{{/i}}</h3>
531
532
  <div class="row">
    <div class="span4">
533
      <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>
534
535
<pre class="prettyprint linenums">
&lt;table class="table"&gt;
536

537
538
539
540
541
542
543
&lt;/table&gt;</pre>
    </div>
    <div class="span8">
      <table class="table">
        <thead>
          <tr>
            <th>#</th>
544
545
546
            <th>{{_i}}First Name{{/i}}</th>
            <th>{{_i}}Last Name{{/i}}</th>
            <th>{{_i}}Language{{/i}}</th>
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
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Mark</td>
            <td>Otto</td>
            <td>CSS</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Jacob</td>
            <td>Thornton</td>
            <td>Javascript</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
            <td>HTML</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>


574
  <h3>2. {{_i}}Striped table{{/i}}</h3>
575
576
  <div class="row">
    <div class="span4">
577
578
      <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> Sprited tables use the <code>:nth-child</code> CSS selector and is not available in IE7-IE8.{{/i}}</p>
579
580
<pre class="prettyprint linenums" style="margin-bottom: 18px;">
&lt;table class="table table-striped"&gt;
581

582
583
584
585
586
587
588
&lt;/table&gt;</pre>
    </div>
    <div class="span8">
      <table class="table table-striped">
        <thead>
          <tr>
            <th>#</th>
589
590
591
            <th>{{_i}}First Name{{/i}}</th>
            <th>{{_i}}Last Name{{/i}}</th>
            <th>{{_i}}Language{{/i}}</th>
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
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Mark</td>
            <td>Otto</td>
            <td>CSS</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Jacob</td>
            <td>Thornton</td>
            <td>Javascript</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
            <td>HTML</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>


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

626
627
628
629
630
631
632
&lt;/table&gt;</pre>
    </div>
    <div class="span8">
      <table class="table table-bordered">
        <thead>
          <tr>
            <th>#</th>
633
634
635
            <th>{{_i}}First Name{{/i}}</th>
            <th>{{_i}}Last Name{{/i}}</th>
            <th>{{_i}}Language{{/i}}</th>
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
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td colspan="2">Mark Otto</td>
            <td>CSS</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Jacob</td>
            <td>Thornton</td>
            <td rowspan="2">Javascript</td>
          </tr>
          </tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Brosef</td>
            <td>Stalin</td>
            <td>HTML</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>


667
  <h3>4. {{_i}}Condensed table{{/i}}</h3>
668
669
  <div class="row">
    <div class="span4">
670
      <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>
671
672
<pre class="prettyprint linenums" style="margin-bottom: 18px;">
&lt;table class="table table-condensed"&gt;
673

674
675
676
677
678
679
680
&lt;/table&gt;</pre>
    </div>
    <div class="span8">
      <table class="table table-condensed">
        <thead>
          <tr>
            <th>#</th>
681
682
683
            <th>{{_i}}First Name{{/i}}</th>
            <th>{{_i}}Last Name{{/i}}</th>
            <th>{{_i}}Language{{/i}}</th>
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Mark</td>
            <td>Otto</td>
            <td>CSS</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Jacob</td>
            <td>Thornton</td>
            <td>Javascript</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
            <td>HTML</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>



Mark Otto's avatar
Mark Otto committed
712
  <h3>5. {{_i}}Combine them all!{{/i}}</h3>
713
714
  <div class="row">
    <div class="span4">
Mark Otto's avatar
Mark Otto committed
715
716
717
718
      <p>{{_i}}Feel free to combine any of the table classes to achieve different looks by utilizing any of the available classes.{{/i}}</p>
<pre class="prettyprint linenums" style="margin-bottom: 18px;">
&lt;table class="table table-striped table-bordered table-condensed"&gt;
  ...
719
720
721
&lt;/table&gt;</pre>
    </div>
    <div class="span8">
Mark Otto's avatar
Mark Otto committed
722
      <table class="table table-striped table-bordered table-condensed">
723
724
725
        <thead>
          <tr>
            <th>#</th>
726
727
728
            <th class="yellow">{{_i}}First Name{{/i}}</th>
            <th class="blue">{{_i}}Last Name{{/i}}</th>
            <th class="green">{{_i}}Language{{/i}}</th>
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Mark</td>
            <td>Otto</td>
            <td>CSS</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Jacob</td>
            <td>Thornton</td>
            <td>Javascript</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Stu</td>
            <td>Dent</td>
            <td>HTML</td>
          </tr>
          <tr>
            <td>4</td>
            <td>Brosef</td>
            <td>Stalin</td>
            <td>HTML</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</section>



<!-- Forms
================================================== -->
<section id="forms">
  <div class="page-header">
768
    <h1>{{_i}}Forms{{/i}}</h1>
769
770
771
  </div>
  <div class="row">
    <div class="span4">
772
773
774
      <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>
775
776
    </div>
    <div class="span4">
777
778
      <h2>{{_i}}Four layouts included{{/i}}</h2>
      <p>{{_i}}Bootstrap comes with support for four types of form layouts:{{/i}}</p>
779
      <ul>
780
781
782
783
        <li>{{_i}}Vertical (default){{/i}}</li>
        <li>{{_i}}Search{{/i}}</li>
        <li>{{_i}}Inline{{/i}}</li>
        <li>{{_i}}Horizontal{{/i}}</li>
784
      </ul>
785
      <p>{{_i}}Different types of form layouts require some changes to markup, but the controls themselves remain and behave the same.{{/i}}</p>
786
787
    </div>
    <div class="span4">
788
789
790
      <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>
791
792
793
    </div>
  </div>

794
795
  <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>
796
797
798
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
799
800
801
        <th>{{_i}}Name{{/i}}</th>
        <th>{{_i}}Class{{/i}}</th>
        <th>{{_i}}Description{{/i}}</th>
802
803
804
805
      </tr>
    </thead>
    <tbody>
      <tr>
806
        <th>{{_i}}Vertical (default){{/i}}</th>
807
        <td><code>.form-vertical</code> <span class="muted">({{_i}}not required{{/i}})</span></td>
808
        <td>{{_i}}Stacked, left-aligned labels over controls{{/i}}</td>
809
810
      </tr>
      <tr>
811
        <th>{{_i}}Horizontal{{/i}}</th>
812
        <td><code>.form-horizontal</code></td>
813
        <td>{{_i}}Float left, right-aligned labels on same line as controls{{/i}}</td>
814
815
      </tr>
      <tr>
816
        <th>{{_i}}Inline{{/i}}</th>
817
        <td><code>.form-inline</code></td>
818
        <td>{{_i}}Left-aligned label and inline-block controls for compact style{{/i}}</td>
819
820
      </tr>
      <tr>
821
        <th>{{_i}}Search{{/i}}</th>
822
        <td><code>.form-search</code></td>
823
        <td>{{_i}}Extra-rounded text input for a typical search aesthetic{{/i}}</td>
824
825
826
827
828
      </tr>
    </tbody>
  </table>


829
  <h2>{{_i}}Example forms <small>using just form controls, no extra markup</small>{{/i}}</h2>
830
  <h3>{{_i}}Basic form{{/i}}</h3>
831
  <div class="row">
832
    <div class="span3">
833
      <p>{{_i}}With v2.0, we have lighter and smarter defaults for form styles. No extra markup, just form controls.{{/i}}</p>
834
835
    </div>
    <div class="span9">
836
      <form class="well">
837
        <label>{{_i}}Label name{{/i}}</label>
838
        <input type="text" class="span3" placeholder="{{_i}}Type something…{{/i}}"> <span class="help-inline">Associated help text!</span>
839
        <label class="checkbox">
840
          <input type="checkbox"> {{_i}}Check me out{{/i}}
841
        </label>
842
        <button type="submit" class="btn">{{_i}}Submit{{/i}}</button>
843
844
      </form>
    </div>
845
846
847
848
  </div> <!-- /row -->
  <h3>{{_i}}Search form{{/i}}</h3>
  <div class="row">
    <div class="span3">
849
      <p>{{_i}}Reflecting default WebKit styles, just add <code>.form-search</code> for extra rounded search fields.{{/i}}</p>
850
851
    </div>
    <div class="span9">
852
853
      <form class="well form-search">
        <input type="text" class="input-medium search-query">
854
        <button type="submit" class="btn">{{_i}}Search{{/i}}</button>
855
856
      </form>
    </div>
857
858
859
860
  </div> <!-- /row -->
  <h3>{{_i}}Inline form{{/i}}</h3>
  <div class="row">
    <div class="span3">
861
      <p>{{_i}}Inputs are block level to start. For <code>.form-inline</code> and <code>.form-horizontal</code>, we use inline-block.{{/i}}</p>
862
863
    </div>
    <div class="span9">
864
      <form class="well form-search">
865
866
867
        <input type="text" class="input-small" placeholder="{{_i}}Email{{/i}}">
        <input type="password" class="input-small" placeholder="{{_i}}Password{{/i}}">
        <button type="submit" class="btn">{{_i}}Go{{/i}}</button>
868
869
870
871
872
873
      </form>
    </div>
  </div><!-- /row -->

  <br>

874
  <h2>{{_i}}Horizontal forms{{/i}}</h2>
875
876
877
  <div class="row">
    <div class="span8">
      <form class="form-horizontal">
878
        <legend>{{_i}}Controls Bootstrap supports{{/i}}</legend>
879
        <fieldset class="control-group">
880
          <label class="control-label" for="input01">{{_i}}Text input{{/i}}</label>
881
882
          <div class="controls">
            <input type="text" class="xlarge" name="input01">
883
            <p class="help-block">{{_i}}In addition to freeform text, any HTML5 text-based input appears like so.{{/i}}</p>
884
885
886
          </div>
        </fieldset>
        <fieldset class="control-group">
887
          <label class="control-label" for="optionsCheckbox">{{_i}}Checkbox{{/i}}</label>
888
889
890
          <div class="controls">
            <label class="checkbox">
              <input type="checkbox" name="optionsCheckbox" value="option1">
891
              {{_i}}Option one is this and that&mdash;be sure to include why it’s great{{/i}}
892
893
894
895
            </label>
          </div>
        </fieldset>
        <fieldset class="control-group">
896
          <label class="control-label" for="select01">{{_i}}Select list{{/i}}</label>
897
898
899
900
901
902
903
904
905
906
907
          <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">
908
          <label class="control-label" for="multiSelect">{{_i}}Multi-select{{/i}}</label>
909
910
911
912
913
914
915
916
917
918
919
          <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>
        <fieldset class="control-group">
920
          <label class="control-label" for="fileInput">{{_i}}File input{{/i}}</label>
921
922
923
924
925
          <div class="controls">
            <input class="input-file" id="fileInput" name="fileInput" type="file">
          </div>
        </fieldset>
        <fieldset class="control-group">
926
          <label class="control-label" for="textarea">{{_i}}Textarea{{/i}}</label>
927
928
929
930
931
          <div class="controls">
            <textarea class="input-xlarge" name="textarea" id="textarea" rows="3"></textarea>
          </div>
        </fieldset>
        <fieldset class="form-actions">
932
933
          <button type="submit" class="btn primary">{{_i}}Save changes{{/i}}</button>
          <button type="reset" class="btn">{{_i}}Cancel{{/i}}</button>
934
935
936
937
938
        </fieldset>
      </form>
    </div>
    <div class="span4">
      <div class="form-docs">
939
940
        <h3>{{_i}}What's included{{/i}}</h3>
        <p>{{_i}}Shown on the left are all the default form controls we support. Here's the bulleted list:{{/i}}</p>
941
        <ul>
942
943
944
945
946
947
948
          <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>
949
950
        </ul>
        <hr>
951
952
        <h3>{{_i}}New defaults with v2.0{{/i}}</h3>
        <p>{{_i}}Up to v1.4, Bootstrap's default form styles used the horizontal layout. With Bootstrap 2, we removed that constraint to have smarter, more scalable defaults for any form.{{/i}}</p>
953
954
955
956
957
958
959
960
961
      </div>
    </div>
  </div>

  <br>

  <div class="row">
    <div class="span8">
      <form class="form-horizontal">
962
        <legend>{{_i}}Form control states{{/i}}</legend>
963
        <fieldset class="control-group">
964
          <label class="control-label" for="focusedInput">{{_i}}Focused input{{/i}}</label>
965
          <div class="controls">
966
            <input class="input-xlarge focused" id="focusedInput" name="focusedInput" type="text" value="{{_i}}This is focused…{{/i}}">
967
968
969
          </div>
        </fieldset>
        <fieldset class="control-group">
970
          <label class="control-label" for="disabledInput">{{_i}}Disabled input{{/i}}</label>
971
          <div class="controls">
972
            <input class="input-xlarge disabled" id="disabledInput" name="disabledInput" type="text" placeholder="{{_i}}Disabled input here…{{/i}}" disabled>
973
974
975
          </div>
        </fieldset>
        <fieldset class="control-group">
976
          <label class="control-label" for="optionsCheckbox">{{_i}}Disabled checkbox{{/i}}</label>
977
978
979
          <div class="controls">
            <label class="checkbox">
              <input type="checkbox" name="optionsCheckbox" value="option1" disabled>
980
              {{_i}}This is a disabled checkbox{{/i}}
981
982
983
984
            </label>
          </div>
        </fieldset>
        <fieldset class="control-group warning">
985
          <label class="control-label" for="inputError">{{_i}}Input with warning{{/i}}</label>
986
987
          <div class="controls">
            <input type="text" name="inputError">
988
            <span class="help-inline">{{_i}}Something may have gone wrong{{/i}}</span>
989
990
991
          </div>
        </fieldset>
        <fieldset class="control-group error">
992
          <label class="control-label" for="inputError">{{_i}}Input with error{{/i}}</label>
993
994
          <div class="controls">
            <input type="text" name="inputError">
995
            <span class="help-inline">{{_i}}Please correct the error{{/i}}</span>
996
997
998
          </div>
        </fieldset>
        <fieldset class="control-group success">
999
          <label class="control-label" for="inputError">{{_i}}Input with success{{/i}}</label>
1000
          <div class="controls">
For faster browsing, not all history is shown. View entire blame