components.html 83.8 KB
Newer Older
1001
1002
1003
1004
1005
                <li class="active"><a href="#">Home</a></li>
                <li><a href="#">Link</a></li>
                <li><a href="#">Link</a></li>
              </ul>
            </div>
1006
1007
          </div>
        </div>
1008
<pre class="prettyprint linenums">
1009
&lt;div class="navbar"&gt;
1010
  &lt;div class="navbar-inner"&gt;
Mark Otto's avatar
Mark Otto committed
1011
1012
1013
1014
1015
1016
    &lt;a class="brand" href="#"&gt;Title&lt;/a&gt;
    &lt;ul class="nav"&gt;
      &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
1017
1018
1019
  &lt;/div&gt;
&lt;/div&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
1020
1021


1022
        <hr class="bs-docs-separator">
Mark Otto's avatar
Mark Otto committed
1023
1024


1025
        <h2>Navbar components</h2>
Mark Otto's avatar
Mark Otto committed
1026

1027
1028
        <h3>Brand</h3>
        <p>A simple link to show your brand or project name only requires an anchor tag.</p>
1029
<pre class="prettyprint linenums">
Mark Otto's avatar
Mark Otto committed
1030
&lt;a class="brand" href="#"&gt;Project name&lt;/a&gt;
1031
</pre>
Mark Otto's avatar
Mark Otto committed
1032

1033
1034
        <h3>Nav links</h3>
        <p>Nav items are simple to add via unordered lists.</p>
1035
<pre class="prettyprint linenums">
Mark Otto's avatar
Mark Otto committed
1036
1037
1038
1039
1040
1041
1042
&lt;ul class="nav"&gt;
  &lt;li class="active"&gt;
    &lt;a href="#">Home&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
1043
</pre>
1044
        <p>You can easily add dividers to your nav links with an empty list item and a simple class. Just add this between links:</p>
1045
<pre class="prettyprint linenums">
Mark Otto's avatar
Mark Otto committed
1046
1047
1048
1049
1050
&lt;ul class="nav"&gt;
  ...
  &lt;li class="divider-vertical"&gt;&lt;/li&gt;
  ...
&lt;/ul&gt;
1051
</pre>
Mark Otto's avatar
Mark Otto committed
1052

1053
1054
        <h3>Forms</h3>
        <p>To properly style and position a form within the navbar, add the appropriate classes as shown below. For a default form, include <code>.navbar-form</code> and either <code>.pull-left</code> or <code>.pull-right</code> to properly align it.</p>
Mark Otto's avatar
Mark Otto committed
1055
1056
1057
1058
1059
<pre class="prettyprint linenums">
&lt;form class="navbar-form pull-left"&gt;
  &lt;input type="text" class="span2"&gt;
&lt;/form&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
1060

1061
1062
        <h3>Search form</h3>
        <p>For a more customized search form, add <code>.navbar-search</code> to the <code>form</code> and <code>.search-query</code> to the input for specialized styles in the navbar.</p>
1063
<pre class="prettyprint linenums">
1064
1065
&lt;form class="navbar-search pull-left"&gt;
  &lt;input type="text" class="search-query" placeholder="Search"&gt;
1066
1067
&lt;/form&gt;
</pre>
Mark Otto's avatar
Mark Otto committed
1068

1069
1070
        <h3>Component alignment</h3>
        <p>Align nav links, search form, or text, use the <code>.pull-left</code> or <code>.pull-right</code> utility classes. Both classes will add a CSS float in the specified direction.</p>
Mark Otto's avatar
Mark Otto committed
1071

1072
1073
        <h3>Using dropdowns</h3>
        <p>Add dropdowns and dropups to the nav with a bit of markup and the <a href="./javascript.html#dropdowns">dropdowns javascript plugin</a>.</p>
Mark Otto's avatar
Mark Otto committed
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
<pre class="prettyprint linenums">
&lt;ul class="nav"&gt;
  &lt;li class="dropdown"&gt;
    &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown">
      Account
      &lt;b class="caret"&gt;&lt;/b&gt;
    &lt;/a&gt;
    &lt;ul class="dropdown-menu"&gt;
      ...
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</pre>
1087
        <p>Visit the <a href="./javascript.html#dropdowns">javascript dropdowns documentation</a> for more markup and information on calling dropdowns.</p>
Mark Otto's avatar
Mark Otto committed
1088

1089
1090
        <h3>Text</h3>
        <p>Wrap strings of text in an element with <code>.navbar-text</code>, usually on a <code>&lt;p&gt;</code> tag for proper leading and color.</p>
Mark Otto's avatar
Mark Otto committed
1091
1092


1093
        <hr class="bs-docs-separator">
Mark Otto's avatar
Mark Otto committed
1094
1095


1096
1097
        <h2>Fixed navigation</h2>
        <p>Fix the navbar to the top or bottom of the viewport with an additional class on the outermost div, <code>.navbar</code>.</p>
Mark Otto's avatar
Mark Otto committed
1098

1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
        <h3>Fixed to top</h3>
        <p>Add <code>.navbar-fixed-top</code> and remember to account for the hidden area underneath it by adding at least 40px <code>padding</code> to the <code>&lt;body&gt;</code>. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS.</p>
        <div class="bs-docs-example bs-navbar-top-example">
          <div class="navbar navbar-fixed-top" style="position: absolute;">
            <div class="navbar-inner">
              <div class="container" style="width: auto; padding: 0 20px;">
                <a class="brand" href="#">Title</a>
                <ul class="nav">
                  <li class="active"><a href="#">Home</a></li>
                  <li><a href="#">Link</a></li>
                  <li><a href="#">Link</a></li>
                </ul>
              </div>
1112
1113
            </div>
          </div>
Mark Otto's avatar
Mark Otto committed
1114
1115
1116
1117
1118
1119
1120
        </div>
<pre class="prettyprint linenums">
&lt;div class="navbar navbar-fixed-top"&gt;
  ...
&lt;/div&gt;
</pre>

1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
        <h3>Fixed to bottom</h3>
        <p>Add <code>.navbar-fixed-bottom</code> instead.</p>
        <div class="bs-docs-example bs-navbar-bottom-example">
          <div class="navbar navbar-fixed-bottom" style="position: absolute;">
            <div class="navbar-inner">
              <div class="container" style="width: auto; padding: 0 20px;">
                <a class="brand" href="#">Title</a>
                <ul class="nav">
                  <li class="active"><a href="#">Home</a></li>
                  <li><a href="#">Link</a></li>
                  <li><a href="#">Link</a></li>
                </ul>
              </div>
1134
1135
            </div>
          </div>
Mark Otto's avatar
Mark Otto committed
1136
1137
1138
1139
1140
1141
1142
1143
        </div>
<pre class="prettyprint linenums">
&lt;div class="navbar navbar-fixed-bottom"&gt;
  ...
&lt;/div&gt;
</pre>


1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
        <hr class="bs-docs-separator">


        <h2>Responsive navbar</h2>
        <p>To implement a collapsing responsive navbar, wrap your navbar content in a containing div, <code>.nav-collapse.collapse</code>, and add the navbar toggle button, <code>.btn-navbar</code>.</p>
        <div class="bs-docs-example">
          <div class="navbar">
            <div class="navbar-inner">
              <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </a>
                <a class="brand" href="#">Title</a>
                <div class="nav-collapse">
                  <ul class="nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                      <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li class="nav-header">Nav header</li>
                        <li><a href="#">Separated link</a></li>
                        <li><a href="#">One more separated link</a></li>
                      </ul>
                    </li>
                  </ul>
                  <form class="navbar-search pull-left" action="">
                    <input type="text" class="search-query span2" placeholder="Search">
                  </form>
                  <ul class="nav pull-right">
                    <li><a href="#">Link</a></li>
                    <li class="divider-vertical"></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                      <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                      </ul>
                    </li>
                  </ul>
                </div><!-- /.nav-collapse -->
              </div>
            </div><!-- /navbar-inner -->
          </div><!-- /navbar -->
        </div>
1199
<pre class="prettyprint linenums">
1200
&lt;div class="navbar"&gt;
1201
1202
  &lt;div class="navbar-inner"&gt;
    &lt;div class="container"&gt;
Jacob Thornton's avatar
Jacob Thornton committed
1203

1204
1205
      &lt;!-- .btn-navbar is used as the toggle for collapsed navbar content --&gt;
      &lt;a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"&gt;
Mark Otto's avatar
Mark Otto committed
1206
1207
1208
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
1209
      &lt;/a&gt;
Jacob Thornton's avatar
Jacob Thornton committed
1210

1211
1212
1213
1214
      &lt;!-- Be sure to leave the brand out there if you want it shown --&gt;
      &lt;a class="brand" href="#"&gt;Project name&lt;/a&gt;

      &lt;!-- Everything you want hidden at 940px or less, place within here --&gt;
1215
      &lt;div class="nav-collapse"&gt;
1216
1217
1218
1219
1220
1221
1222
        &lt;!-- .nav, .navbar-search, .navbar-form, etc --&gt;
      &lt;/div&gt;

    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
1223
1224
1225
        <div class="alert alert-info">
          <strong>Heads up!</strong> The responsive navbar requires the <a href="./javascript.html#collapse">collapse plugin</a> and <a href="./scaffolding.html#responsive">responsive Bootstrap CSS file</a>.
        </div>
1226
1227


1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
        <hr class="bs-docs-separator">


        <h2>Subnav variation</h2>
        <p>Modify the look of the navbar by adding <code>.navbar-subnav</code>. Perfect for a secondary nav, or just a replacement to the default dark navbar.</p>
        <div class="bs-docs-example">
          <div class="navbar navbar-subnav" style="position: static;">
            <div class="navbar-inner">
              <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".subnav-collapse">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </a>
                <a class="brand" href="#">Title</a>
                <div class="nav-collapse subnav-collapse">
                  <ul class="nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                      <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li class="nav-header">Nav header</li>
                        <li><a href="#">Separated link</a></li>
                        <li><a href="#">One more separated link</a></li>
                      </ul>
                    </li>
                  </ul>
                  <form class="navbar-search pull-left" action="">
                    <input type="text" class="search-query span2" placeholder="Search">
                  </form>
                  <ul class="nav pull-right">
                    <li><a href="#">Link</a></li>
                    <li class="divider-vertical"></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                      <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                      </ul>
                    </li>
                  </ul>
                </div><!-- /.nav-collapse -->
              </div>
            </div><!-- /navbar-inner -->
          </div><!-- /navbar -->
        </div>
Mark Otto's avatar
Mark Otto committed
1283
1284
1285
1286
1287
<pre class="prettyprint linenums">
&lt;div class="navbar navbar-subnav"&gt;
  ...
&lt;/div&gt;
</pre>
1288

1289
      </section>
1290
1291
1292



1293
1294
1295
1296
1297
1298
      <!-- Breadcrumbs
      ================================================== -->
      <section id="breadcrumbs">
        <div class="page-header">
          <h1>Breadcrumbs <small></small></h1>
        </div>
1299

1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
        <h2>Examples</h2>
        <p>A single example shown as it might be displayed across multiple pages.</p>
        <div class="bs-docs-example">
          <ul class="breadcrumb">
            <li class="active">Home</li>
          </ul>
          <ul class="breadcrumb">
            <li><a href="#">Home</a> <span class="divider">/</span></li>
            <li class="active">Library</li>
          </ul>
          <ul class="breadcrumb" style="margin-bottom: 5px;">
            <li><a href="#">Home</a> <span class="divider">/</span></li>
            <li><a href="#">Library</a> <span class="divider">/</span></li>
            <li class="active">Data</li>
          </ul>
        </div>
1316
1317
<pre class="prettyprint linenums">
&lt;ul class="breadcrumb"&gt;
Mark Otto's avatar
Mark Otto committed
1318
1319
  &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt; &lt;span class="divider"&gt;/&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Library&lt;/a&gt; &lt;span class="divider"&gt;/&lt;/span&gt;&lt;/li&gt;
1320
  &lt;li class="active"&gt;Data&lt;/li&gt;
1321
1322
1323
&lt;/ul&gt;
</pre>

1324
      </section>
1325
1326
1327



1328
1329
1330
1331
1332
1333
      <!-- Pagination
      ================================================== -->
      <section id="pagination">
        <div class="page-header">
          <h1>Pagination <small>Two options for paging through content</small></h1>
        </div>
1334

1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
        <h2>Standard pagination</h2>
        <p>Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.</p>
        <div class="bs-docs-example">
          <div class="pagination">
            <ul>
              <li><a href="#">&laquo;</a></li>
              <li><a href="#">1</a></li>
              <li><a href="#">2</a></li>
              <li><a href="#">3</a></li>
              <li><a href="#">4</a></li>
              <li><a href="#">5</a></li>
              <li><a href="#">&raquo;</a></li>
            </ul>
          </div>
1349
        </div>
1350
1351
1352
<pre class="prettyprint linenums">
&lt;div class="pagination"&gt;
  &lt;ul&gt;
Mark Otto's avatar
Mark Otto committed
1353
    &lt;li&gt;&lt;a href="#"&gt;Prev&lt;/a&gt;&lt;/li&gt;
Mark Otto's avatar
Mark Otto committed
1354
    &lt;li&gt;&lt;a href="#"&gt;1&lt;/a&gt;&lt;/li&gt;
1355
1356
1357
    &lt;li&gt;&lt;a href="#"&gt;2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;3&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;4&lt;/a&gt;&lt;/li&gt;
Mark Otto's avatar
Mark Otto committed
1358
1359
1360
1361
1362
1363
    &lt;li&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</pre>


1364
        <hr class="bs-docs-separator">
Mark Otto's avatar
Mark Otto committed
1365
1366


1367
        <h2>Options</h2>
Mark Otto's avatar
Mark Otto committed
1368

1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
        <h3>Disabled and active states</h3>
        <p>Links are customizable for different circumstances. Use <code>.disabled</code> for unclickable links and <code>.active</code> to indicate the current page.</p>
        <div class="bs-docs-example">
          <div class="pagination pagination-centered">
            <ul>
              <li class="disabled"><a href="#">&laquo;</a></li>
              <li class="active"><a href="#">1</a></li>
              <li><a href="#">2</a></li>
              <li><a href="#">3</a></li>
              <li><a href="#">4</a></li>
              <li><a href="#">5</a></li>
              <li><a href="#">&raquo;</a></li>
           </ul>
          </div>
1383
        </div>
Mark Otto's avatar
Mark Otto committed
1384
1385
1386
<pre class="prettyprint linenums">
&lt;div class="pagination "&gt;
  &lt;ul&gt;
Mark Otto's avatar
Mark Otto committed
1387
    &lt;li class="disabled"&gt;&lt;a href="#"&gt;Prev&lt;/a&gt;&lt;/li&gt;
Mark Otto's avatar
Mark Otto committed
1388
1389
    &lt;li class="active"&gt;&lt;a href="#"&gt;1&lt;/a&gt;&lt;/li&gt;
    ...
1390
1391
1392
1393
  &lt;/ul&gt;
&lt;/div&gt;
</pre>

1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
        <h3>Alignment</h3>
        <p>Add one of two optional classes to change the alignment of pagination links: <code>.pagination-centered</code> and <code>.pagination-right</code>.</p>
        <div class="bs-docs-example">
          <div class="pagination pagination-centered">
            <ul>
              <li><a href="#">&laquo;</a></li>
              <li><a href="#">1</a></li>
              <li><a href="#">2</a></li>
              <li><a href="#">3</a></li>
              <li><a href="#">4</a></li>
              <li><a href="#">5</a></li>
              <li><a href="#">&raquo;</a></li>
           </ul>
          </div>
1408
        </div>
Mark Otto's avatar
Mark Otto committed
1409
1410
1411
1412
1413
<pre class="prettyprint linenums">
&lt;div class="pagination pagination-centered"&gt;
  ...
&lt;/div&gt;
</pre>
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
        <div class="bs-docs-example">
          <div class="pagination pagination-right">
            <ul>
              <li><a href="#">&laquo;</a></li>
              <li><a href="#">1</a></li>
              <li><a href="#">2</a></li>
              <li><a href="#">3</a></li>
              <li><a href="#">4</a></li>
              <li><a href="#">5</a></li>
              <li><a href="#">&raquo;</a></li>
            </ul>
          </div>
1426
        </div>
Mark Otto's avatar
Mark Otto committed
1427
1428
1429
1430
1431
1432
1433
<pre class="prettyprint linenums">
&lt;div class="pagination pagination-right"&gt;
  ...
&lt;/div&gt;
</pre>


1434
        <hr class="bs-docs-separator">
1435

Mark Otto's avatar
Mark Otto committed
1436

1437
1438
        <h2>Pager</h2>
        <p>Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines.</p>
1439

1440
1441
1442
1443
1444
1445
1446
1447
        <h3>Default example</h3>
        <p>By default, the pager centers links.</p>
        <div class="bs-docs-example">
          <ul class="pager">
            <li><a href="#">Previous</a></li>
            <li><a href="#">Next</a></li>
          </ul>
        </div>
1448
1449
<pre class="prettyprint linenums">
&lt;ul class="pager"&gt;
1450
1451
  &lt;li&gt;&lt;a href="#"&gt;Previous&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt;
1452
1453
&lt;/ul&gt;
</pre>
1454

1455
1456
1457
1458
1459
1460
1461
1462
        <h3>Aligned links</h3>
        <p>Alternatively, you can align each link to the sides:</p>
        <div class="bs-docs-example">
          <ul class="pager">
            <li class="previous"><a href="#">&larr; Older</a></li>
            <li class="next"><a href="#">Newer &rarr;</a></li>
          </ul>
        </div>
1463
1464
<pre class="prettyprint linenums">
&lt;ul class="pager"&gt;
1465
  &lt;li class="previous"&gt;
1466
1467
    &lt;a href="#"&gt;&amp;larr; Older&lt;/a&gt;
  &lt;/li&gt;
1468
  &lt;li class="next"&gt;
1469
1470
1471
    &lt;a href="#"&gt;Newer &amp;rarr;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;
Mark Otto's avatar
Mark Otto committed
1472
1473
</pre>

1474
1475
1476
1477
1478
1479
1480
1481
        <h3>Optional disabled state</h3>
        <p>Pager links also use the general <code>.disabled</code> utility class from the pagination.</p>
        <div class="bs-docs-example">
          <ul class="pager">
            <li class="previous disabled"><a href="#">&larr; Older</a></li>
            <li class="next"><a href="#">Newer &rarr;</a></li>
          </ul>
        </div>
Mark Otto's avatar
Mark Otto committed
1482
1483
1484
1485
1486
1487
1488
<pre class="prettyprint linenums">
&lt;ul class="pager"&gt;
  &lt;li class="previous disabled"&gt;
    &lt;a href="#"&gt;&amp;larr; Older&lt;/a&gt;
  &lt;/li&gt;
  ...
&lt;/ul&gt;
1489
</pre>
1490

1491
      </section>
1492
1493
1494



1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
      <!-- Labels and badges
      ================================================== -->
      <section id="labels-badges">
        <div class="page-header">
          <h1>Labels and badges</h1>
        </div>
        <h3>Labels</h3>
        <table class="table table-bordered table-striped">
          <thead>
            <tr>
              <th>Labels</th>
              <th>Markup</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>
                <span class="label">Default</span>
              </td>
              <td>
                <code>&lt;span class="label"&gt;Default&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                <span class="label label-success">Success</span>
              </td>
              <td>
                <code>&lt;span class="label label-success"&gt;Success&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                <span class="label label-warning">Warning</span>
              </td>
              <td>
                <code>&lt;span class="label label-warning"&gt;Warning&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                <span class="label label-important">Important</span>
              </td>
              <td>
                <code>&lt;span class="label label-important"&gt;Important&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                <span class="label label-info">Info</span>
              </td>
              <td>
                <code>&lt;span class="label label-info"&gt;Info&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                <span class="label label-inverse">Inverse</span>
              </td>
              <td>
                <code>&lt;span class="label label-inverse"&gt;Inverse&lt;/span&gt;</code>
              </td>
            </tr>
          </tbody>
        </table>

        <h3>Badges</h3>
        <table class="table table-bordered table-striped">
          <thead>
            <tr>
              <th>Name</th>
              <th>Example</th>
              <th>Markup</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>
                Default
              </td>
              <td>
                <span class="badge">1</span>
              </td>
              <td>
                <code>&lt;span class="badge"&gt;1&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                Success
              </td>
              <td>
                <span class="badge badge-success">2</span>
              </td>
              <td>
                <code>&lt;span class="badge badge-success"&gt;2&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                Warning
              </td>
              <td>
                <span class="badge badge-warning">4</span>
              </td>
              <td>
                <code>&lt;span class="badge badge-warning"&gt;4&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                Important
              </td>
              <td>
                <span class="badge badge-important">6</span>
              </td>
              <td>
                <code>&lt;span class="badge badge-important"&gt;6&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                Info
              </td>
              <td>
                <span class="badge badge-info">8</span>
              </td>
              <td>
                <code>&lt;span class="badge badge-info"&gt;8&lt;/span&gt;</code>
              </td>
            </tr>
            <tr>
              <td>
                Inverse
              </td>
              <td>
                <span class="badge badge-inverse">10</span>
              </td>
              <td>
                <code>&lt;span class="badge badge-inverse"&gt;10&lt;/span&gt;</code>
              </td>
            </tr>
          </tbody>
        </table>

      </section>



      <!-- Typographic components
      ================================================== -->
      <section id="typography">
        <div class="page-header">
          <h1>Typographic components</h1>
        </div>
1650

1651
1652
1653
1654
1655
1656
1657
1658
        <h2>Hero unit</h2>
        <p>A lightweight, flexible component to showcase key content on your site. It works well on marketing and content-heavy sites.</p>
        <div class="bs-docs-example">
          <div class="hero-unit">
            <h1>Hello, world!</h1>
            <p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
            <p><a class="btn btn-primary btn-large">Learn more</a></p>
          </div>
1659
        </div>
Mark Otto's avatar
Mark Otto committed
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
<pre class="prettyprint linenums">
&lt;div class="hero-unit"&gt;
  &lt;h1&gt;Heading&lt;/h1&gt;
  &lt;p&gt;Tagline&lt;/p&gt;
  &lt;p&gt;
    &lt;a class="btn btn-primary btn-large"&gt;
      Learn more
    &lt;/a&gt;
  &lt;/p&gt;
&lt;/div&gt;
</pre>
1671

1672
1673
1674
1675
1676
1677
        <h2>Page header</h2>
        <p>A simple shell for an <code>h1</code> to appropriately space out and segment sections of content on a page. It can utilize the <code>h1</code>'s default <code>small</code>, element as well most other components (with additional styles).</p>
        <div class="bs-docs-example">
          <div class="page-header">
            <h1>Example page header <small>Subtext for header</small></h1>
          </div>
1678
        </div>
1679
<pre class="prettyprint linenums">
1680
&lt;div class="page-header"&gt;
1681
1682
1683
  &lt;h1&gt;Example page header&lt;/h1&gt;
&lt;/div&gt;
</pre>
1684

1685
      </section>
Mark Otto's avatar
Mark Otto committed
1686
1687
1688



1689
1690
1691
1692
1693
1694
      <!-- Thumbnails
      ================================================== -->
      <section id="thumbnails">
        <div class="page-header">
          <h1>Thumbnails <small>Grids of images, videos, text, and more</small></h1>
        </div>
1695

1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
        <h2>Default thumbnails</h2>
        <p>By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.</p>
        <div class="row-fluid">
          <ul class="thumbnails">
            <li class="span3">
              <a href="#" class="thumbnail">
                <img src="http://placehold.it/260x180" alt="">
              </a>
            </li>
            <li class="span3">
              <a href="#" class="thumbnail">
                <img src="http://placehold.it/260x180" alt="">
              </a>
            </li>
            <li class="span3">
              <a href="#" class="thumbnail">
                <img src="http://placehold.it/260x180" alt="">
              </a>
            </li>
            <li class="span3">
              <a href="#" class="thumbnail">
                <img src="http://placehold.it/260x180" alt="">
              </a>
            </li>
          </ul>
        </div>
1722

1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
        <h2>Highly customizable</h2>
        <p>With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.</p>
        <div class="row-fluid">
          <ul class="thumbnails">
            <li class="span4">
              <div class="thumbnail">
                <img src="http://placehold.it/300x200" alt="">
                <div class="caption">
                  <h3>Thumbnail label</h3>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                  <p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
                </div>
1735
              </div>
1736
1737
1738
1739
1740
1741
1742
1743
1744
            </li>
            <li class="span4">
              <div class="thumbnail">
                <img src="http://placehold.it/300x200" alt="">
                <div class="caption">
                  <h3>Thumbnail label</h3>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                  <p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
                </div>
1745
              </div>
1746
1747
1748
1749
1750
1751
1752
1753
1754
            </li>
            <li class="span4">
              <div class="thumbnail">
                <img src="http://placehold.it/300x200" alt="">
                <div class="caption">
                  <h3>Thumbnail label</h3>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                  <p><a href="#" class="btn btn-primary">Action</a> <a href="#" class="btn">Action</a></p>
                </div>
1755
              </div>
1756
1757
1758
            </li>
          </ul>
        </div>
1759

1760
1761
        <h3>Why use thumbnails</h3>
        <p>Thumbnails (previously <code>.media-grid</code> up until v1.4) are great for grids of photos or videos, image search results, retail products, portfolios, and much more. They can be links or static content.</p>
1762

1763
1764
        <h3>Simple, flexible markup</h3>
        <p>Thumbnail markup is simple&mdash;a <code>ul</code> with any number of <code>li</code> elements is all that is required. It's also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.</p>
1765

1766
1767
        <h3>Uses grid column sizes</h3>
        <p>Lastly, the thumbnails component uses existing grid system classes&mdash;like <code>.span2</code> or <code>.span3</code>&mdash;for control of thumbnail dimensions.</p>
1768

1769
1770
        <h2>Markup</h2>
        <p>As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup <strong>for linked images</strong>:</p>
1771
1772
<pre class="prettyprint linenums">
&lt;ul class="thumbnails"&gt;
1773
  &lt;li class="span4"&gt;
1774
    &lt;a href="#" class="thumbnail"&gt;
1775
      &lt;img src="http://placehold.it/300x200" alt=""&gt;
1776
1777
1778
1779
1780
    &lt;/a&gt;
  &lt;/li&gt;
  ...
&lt;/ul&gt;
</pre>
1781
        <p>For custom HTML content in thumbnails, the markup changes slightly. To allow block level content anywhere, we swap the <code>&lt;a&gt;</code> for a <code>&lt;div&gt;</code> like so:</p>
1782
1783
<pre class="prettyprint linenums">
&lt;ul class="thumbnails"&gt;
1784
  &lt;li class="span4"&gt;
1785
    &lt;div class="thumbnail"&gt;
1786
1787
1788
      &lt;img src="http://placehold.it/300x200" alt=""&gt;
      &lt;h3&gt;Thumbnail label&lt;/h3&gt;
      &lt;p&gt;Thumbnail caption...&lt;/p&gt;
1789
1790
1791
1792
1793
    &lt;/div&gt;
  &lt;/li&gt;
  ...
&lt;/ul&gt;
</pre>
1794

1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
        <h2>More examples</h2>
        <p>Explore all your options with the various grid classes available to you. You can also mix and match different sizes.</p>
        <ul class="thumbnails">
          <li class="span4">
            <a href="#" class="thumbnail">
              <img src="http://placehold.it/360x268" alt="">
            </a>
          </li>
          <li class="span3">
            <a href="#" class="thumbnail">
              <img src="http://placehold.it/260x120" alt="">
            </a>
          </li>
          <li class="span2">
            <a href="#" class="thumbnail">
              <img src="http://placehold.it/160x120" alt="">
            </a>
          </li>
          <li class="span3">
            <a href="#" class="thumbnail">
              <img src="http://placehold.it/260x120" alt="">
            </a>
          </li>
          <li class="span2">
            <a href="#" class="thumbnail">
              <img src="http://placehold.it/160x120" alt="">
            </a>
          </li>
        </ul>
1824

1825
      </section>
1826
1827
1828



1829
1830
1831
1832
1833
1834
      <!-- Alerts
      ================================================== -->
      <section id="alerts">
        <div class="page-header">
          <h1>Alerts <small>Styles for success, warning, and error messages</small></h1>
        </div>
1835

1836
1837
1838
1839
1840
1841
1842
        <h2>Default alert</h2>
        <p>Wrap any text and an optional dismiss button in <code>.alert</code> for a basic warning alert message.</p>
        <div class="bs-docs-example">
          <div class="alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <strong>Warning!</strong> Best check yo self, you're not looking too good.
          </div>
1843
        </div>
1844
1845
<pre class="prettyprint linenums">
&lt;div class="alert"&gt;
1846
  &lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt;
Mark Otto's avatar
Mark Otto committed
1847
  &lt;strong&gt;Warning!&lt;/strong&gt; Best check yo self, you're not looking too good.
1848
1849
&lt;/div&gt;
</pre>
1850

1851
1852
        <h3>Dismiss buttons</h3>
        <p>Mobile Safari and Mobile Opera browsers, in addition to the <code>data-dismiss="alert"</code> attribute, require an <code>href="#"</code> for the dismissal of alerts when using an <code>&lt;a&gt;</code> tag.</p>
1853
1854
1855
<pre class="prettyprint linenums">
&lt;a href="#" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt;
</pre>
1856
        <p>Alternatively, you may use a <code>&lt;button&gt;</code> element with the data attribute, which we have opted to do for our docs. When using <code>&lt;button&gt;</code>, you must include <code>type="button"</code> or your forms may not submit.</p>
1857
1858
1859
1860
<pre class="prettyprint linenums">
&lt;button type="button" class="close" data-dismiss="alert"&gt;&times;&lt;/button&gt;
</pre>

1861
1862
        <h3>Dismiss alerts via javascript</h3>
        <p>Use the <a href="./javascript.html#alerts">alerts jQuery plugin</a> for quick and easy dismissal of alerts.</p>
1863
1864


1865
        <hr class="bs-docs-separator">
1866
1867


1868
1869
1870
1871
1872
1873
1874
1875
        <h2>Options</h2>
        <p>For longer messages, increase the padding on the top and bottom of the alert wrapper by adding <code>.alert-block</code>.</p>
        <div class="bs-docs-example">
          <div class="alert alert-block">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <h4>Warning!</h4>
            <p>Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
          </div>
1876
        </div>
1877
<pre class="prettyprint linenums">
1878
&lt;div class="alert alert-block"&gt;
1879
1880
  &lt;a class="close" data-dismiss="alert" href="#"&gt;&amp;times;&lt;/a&gt;
  &lt;h4&gt;Warning!&lt;/h4&gt;
Mark Otto's avatar
Mark Otto committed
1881
  Best check yo self, you're not...
1882
1883
&lt;/div&gt;
</pre>
1884

1885

1886
        <hr class="bs-docs-separator">
1887
1888


1889
1890
        <h2>Contextual alternatives</h2>
        <p>Add optional classes to change an alert's connotation.</p>
1891

1892
1893
1894
1895
1896
1897
        <h3>Error or danger</h3>
        <div class="bs-docs-example">
          <div class="alert alert-error">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <strong>Oh snap!</strong> Change a few things up and try submitting again.
          </div>
1898
        </div>
1899
<pre class="prettyprint linenums">
1900
&lt;div class="alert alert-error"&gt;
1901
1902
1903
  ...
&lt;/div&gt;
</pre>
1904

1905
1906
1907
1908
1909
1910
        <h3>Success</h3>
        <div class="bs-docs-example">
          <div class="alert alert-success">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <strong>Well done!</strong> You successfully read this important alert message.
          </div>
1911
        </div>
1912
<pre class="prettyprint linenums">
1913
&lt;div class="alert alert-success"&gt;
1914
1915
1916
  ...
&lt;/div&gt;
</pre>
1917

1918
1919
1920
1921
1922
1923
        <h3>Information</h3>
        <div class="bs-docs-example">
          <div class="alert alert-info">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <strong>Heads up!</strong> This alert needs your attention, but it's not super important.
          </div>
1924
        </div>
1925
<pre class="prettyprint linenums">
1926
&lt;div class="alert alert-info"&gt;
1927
  ...
1928
1929
&lt;/div&gt;
</pre>
1930

1931
      </section>
1932
1933
1934



1935
1936
1937
1938
1939
1940
      <!-- Progress bars
      ================================================== -->
      <section id="progress">
        <div class="page-header">
          <h1>Progress bars <small>For loading, redirecting, or action status</small></h1>
        </div>
1941

1942
        <h2>Examples and markup</h2>
1943

1944
1945
1946
1947
1948
1949
        <h3>Basic</h3>
        <p>Default progress bar with a vertical gradient.</p>
        <div class="bs-docs-example">
          <div class="progress">
            <div class="bar" style="width: 60%;"></div>
          </div>
1950
        </div>
1951
1952
<pre class="prettyprint linenums">
&lt;div class="progress"&gt;
1953
  &lt;div class="bar" style="width: 60%;"&gt;&lt;/div&gt;
1954
1955
&lt;/div&gt;
</pre>
1956

1957
1958
1959
1960
1961
1962
        <h3>Striped</h3>
        <p>Uses a gradient to create a striped effect. Not available in IE7-8.</p>
        <div class="bs-docs-example">
          <div class="progress progress-striped">
            <div class="bar" style="width: 20%;"></div>
          </div>
1963
        </div>
1964
<pre class="prettyprint linenums">
1965
&lt;div class="progress progress-striped"&gt;
1966
  &lt;div class="bar" style="width: 20%;"&gt;&lt;/div&gt;
1967
1968
&lt;/div&gt;
</pre>
1969

1970
1971
1972
1973
1974
1975
        <h3>Animated</h3>
        <p>Add <code>.active</code> to <code>.progress-striped</code> to animate the stripes right to left. Not available in all versions of IE.</p>
        <div class="bs-docs-example">
          <div class="progress progress-striped active">
            <div class="bar" style="width: 45%"></div>
          </div>
1976
        </div>
1977
<pre class="prettyprint linenums">
1978
1979
&lt;div class="progress progress-striped active"&gt;
  &lt;div class="bar" style="width: 40%;"&gt;&lt;/div&gt;
1980
1981
&lt;/div&gt;
</pre>
1982

1983

1984
        <hr class="bs-docs-separator">
1985
1986


1987
        <h2>Options</h2>
1988

1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
        <h3>Additional colors</h3>
        <p>Progress bars use some of the same button and alert classes for consistent styles.</p>
        <div class="bs-docs-example">
          <div class="progress progress-info" style="margin-bottom: 9px;">
            <div class="bar" style="width: 20%"></div>
          </div>
          <div class="progress progress-success" style="margin-bottom: 9px;">
            <div class="bar" style="width: 40%"></div>
          </div>
          <div class="progress progress-warning" style="margin-bottom: 9px;">
            <div class="bar" style="width: 60%"></div>
          </div>
For faster browsing, not all history is shown. View entire blame