{{_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}}
{{_i}}All HTML headings, <h1>
through <h6>
are available.{{/i}}
{{_i}}Bootstrap's global default font-size
is 13px, with a line-height
of 18px. This is applied to the <body>
and all paragraphs. In addition, <p>
(paragraphs) receive a bottom margin of half their line-height (9px by default).{{/i}}
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.
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.
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.
{{_i}}Make a paragraph stand out by adding .lead
.{{/i}}
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
{{_i}}The typographic scale is based on two LESS variables in variables.less: @baseFontSize
and @baseLineHeight
. The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.{{/i}}
{{_i}}Make use of HTML's default emphasis tags, <strong>
and <em>
.{{/i}}
<strong>
{{_i}}For emphasizing a snippet of text with important{{/i}}
The following snippet of text is rendered as bold text.
<strong>rendered as bold text</strong>
<em>
{{_i}}For emphasizing a snippet of text with stress{{/i}}
The following snippet of text is rendered as italicized text.
<em>rendered as italicized text</em>
{{_i}}Heads up!{{/i}} {{_i}}Feel free to use <b>
and <i>
in HTML5. <b>
is meant to highlight words or phrases without conveying additional importance while <i>
is mostly for voice, technical terms, etc.{{/i}}
{{_i}}Stylized implemenation of HTML's <abbr>
element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a title
attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover.{{/i}}
<abbr>
{{_i}}For expanded text on long hover of an abbreviation, include the title
attribute.{{/i}}
{{_i}}An abbreviation of the word attribute is attr.{{/i}}
<abbr title="attribute">attr</abbr>
<abbr class="initialism">
{{_i}}Add .initialism
to an abbreviation for a slightly smaller font-size.{{/i}}
{{_i}}HTML is the best thing since sliced bread.{{/i}}
<abbr title="attribute" class="initialism">attr</abbr>
{{_i}}Present contact information for the nearest ancestor or the entire body of work.{{/i}}
<address>
{{_i}}Preserve formatting by ending all lines with <br>
.{{/i}}
<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>
{{_i}}For quoting blocks of content from another source within your document.{{/i}}
{{_i}}Wrap <blockquote>
around any HTML as the quote. For straight quotes we recommend a <p>
.{{/i}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
<blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> </blockquote>
{{_i}}Style and content changes for simple variations on a standard blockquote.{{/i}}
{{_i}}Add <small>
tag for identifying the source. Wrap the name of the source work in <cite>
.{{/i}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
{{_i}}Someone famous in Source Title{{/i}}
<blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <small>{{_i}}Someone famous <cite title="Source Title">Source Title</cite>{{/i}}</small> </blockquote>
{{_i}}Use .pull-left
and .pull-right
classes for floated, right-aligned blockquote content.{{/i}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
{{_i}}Someone famous in Source Title{{/i}}
<blockquote class="pull-right"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <small>{{_i}}Someone famous <cite title="Source Title">Source Title</cite>{{/i}}</small> </blockquote>
{{_i}}A list of items in which the order does not explicitly matter.{{/i}}
<ul> <li>...</li> </ul>
{{_i}}A list of items in which the order does explicitly matter.{{/i}}
<ol> <li>...</li> </ol>
{{_i}}A list of items with no list-style
or additional left padding.{{/i}}
<ul class="unstyled"> <li>...</li> </ul>
{{_i}}A list of terms with their associated descriptions.{{/i}}
<dl> <dt>...</dt> <dd>...</dd> </dl>
{{_i}}Make terms and descriptions in <dl>
line up side-by-side.{{/i}}
<dl class="dl-horizontal"> <dt>...</dt> <dd>...</dd> </dl>
{{_i}}Heads up!{{/i}}
{{_i}}Horizontal description lists will truncate terms that are too long to fit in the left column fix text-overflow
. In narrower viewports, they will change to the default stacked layout.{{/i}}
Wrap inline snippets of code with <code>
.
{{_i}}For example, <code>section</code> should be wrapped as inline.{{/i}}
{{_i}}Use <pre>
for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.{{/i}}
<p>{{_i}}Sample text here...{{/i}}</p>
<pre> <p>{{_i}}Sample text here...{{/i}}</p> </pre>
{{_i}}Note: Be sure to keep code within <pre>
tags as close to the left as possible; it will render all tabs.{{/i}}
{{_i}}You may optionally add the .pre-scrollable
class which will set a max-height of 350px and provide a y-axis scrollbar.{{/i}}
{{_i}}For basic styling—light padding and only horizontal dividers—add the base class .table
to any <table>
.{{/i}}
# | {{_i}}First Name{{/i}} | {{_i}}Last Name{{/i}} | {{_i}}Username{{/i}} |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
<table class="table"> … </table>
{{_i}}Add any of the follow classes to the .table
base class.{{/i}}
{{_i}}.table-striped{{/i}}
{{_i}}Adds zebra-striping to any table row within the <tbody>
via the :nth-child
CSS selector (not available in IE7-IE8).{{/i}}
# | {{_i}}First Name{{/i}} | {{_i}}Last Name{{/i}} | {{_i}}Username{{/i}} |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
<table class="table table-striped"> … </table>
{{_i}}.table-bordered{{/i}}
{{_i}}Add borders and rounded corners to the table.{{/i}}
# | {{_i}}First Name{{/i}} | {{_i}}Last Name{{/i}} | {{_i}}Username{{/i}} |
---|---|---|---|
1 | Mark | Otto | @mdo |
Mark | Otto | @TwBootstrap | |
2 | Jacob | Thornton | @fat |
3 | Larry the Bird |
<table class="table table-bordered"> … </table>
{{_i}}.table-condensed{{/i}}
{{_i}}Makes tables more compact by cutting cell padding in half.{{/i}}
# | {{_i}}First Name{{/i}} | {{_i}}Last Name{{/i}} | {{_i}}Username{{/i}} |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry the Bird |
<table class="table table-condensed"> … </table>
{{_i}}List of supported table HTML elements and how they should be used.{{/i}}
{{_i}}Tag{{/i}} | {{_i}}Description{{/i}} |
---|---|
<table>
|
{{_i}}Wrapping element for displaying data in a tabular format{{/i}} |
<thead>
|
{{_i}}Container element for table header rows (<tr> ) to label table columns{{/i}}
|
<tbody>
|
{{_i}}Container element for table rows (<tr> ) in the body of the table{{/i}}
|
<tr>
|
{{_i}}Container element for a set of table cells (<td> or <th> ) that appears on a single row{{/i}}
|
<td>
|
{{_i}}Default table cell{{/i}} |
<th>
|
{{_i}}Special table cell for column (or row, depending on scope and placement) labels{{/i}} {{_i}}Must be used within a <thead> {{/i}}
|
<caption>
|
{{_i}}Description or summary of what the table holds, especially useful for screen readers{{/i}} |
<table> <thead> <tr> <th>…</th> <th>…</th> </tr> </thead> <tbody> <tr> <td>…</td> <td>…</td> </tr> </tbody> </table>
{{_i}}Forms include styles for all the base form controls like input
, textarea
, and select
you'd expect. There are also a number of custom components like appended and prepended inputs and support for lists of checkboxes.{{/i}}
{{_i}}Bootstrap provides simple markup and styles for four styles of common web forms. Each layout requires small changes to surrounding markup, but the controls themselves remain and behave the same.{{/i}}
{{_i}}Error, warning, and success states are included for form controls, as wel as disabled.{{/i}}
{{_i}}Name{{/i}} | {{_i}}Class{{/i}} | {{_i}}Description{{/i}} |
---|---|---|
{{_i}}Vertical (default){{/i}} | .form-vertical ({{_i}}not required{{/i}}) |
{{_i}}Stacked, left-aligned labels over controls{{/i}} |
{{_i}}Inline{{/i}} | .form-inline |
{{_i}}Left-aligned label and inline-block controls for compact style{{/i}} |
{{_i}}Search{{/i}} | .form-search |
{{_i}}Extra-rounded text input for a typical search aesthetic{{/i}} |
{{_i}}Horizontal{{/i}} | .form-horizontal |
{{_i}}Float left, right-aligned labels on same line as controls{{/i}} |
{{_i}}Smart and lightweight defaults without extra markup.{{/i}}
{{! /example }}<form class="well"> <label>{{_i}}Label name{{/i}}</label> <input type="text" class="span3" placeholder="{{_i}}Type something…{{/i}}"> <span class="help-block">Example block-level help text here.</span> <label class="checkbox"> <input type="checkbox"> {{_i}}Check me out{{/i}} </label> <button type="submit" class="btn">{{_i}}Submit{{/i}}</button> </form>
{{_i}}Add .form-search
to the form and .search-query
to the input
.{{/i}}
<form class="well form-search"> <input type="text" class="input-medium search-query"> <button type="submit" class="btn">{{_i}}Search{{/i}}</button> </form>
{{_i}}Add .form-inline
to finesse the vertical alignment and spacing of form controls.{{/i}}
<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>
{{_i}}Shown on the right are all the default form controls we support. Here's the bulleted list:{{/i}}
{{_i}}Given the above example form layout, here's the markup associated with the first input and control group. The .control-group
, .control-label
, and .controls
classes are all required for styling.{{/i}}
<form class="form-horizontal"> <fieldset> <legend>{{_i}}Legend text{{/i}}</legend> <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}}Supporting help text{{/i}}</p> </div> </div> </fieldset> </form>
{{_i}}Bootstrap features styles for browser-supported focused and disabled
states. We remove the default Webkit outline
and apply a box-shadow
in its place for :focus
.{{/i}}
{{_i}}It also includes validation styles for errors, warnings, and success. To use, add the error class to the surrounding .control-group
.{{/i}}
<fieldset class="control-group error"> … </fieldset>
{{_i}}Input groups—with appended or prepended text—provide an easy way to give more context for your inputs. Great examples include the @ sign for Twitter usernames or $ for finances.{{/i}}
{{_i}}Up to v1.4, Bootstrap required extra markup around checkboxes and radios to stack them. Now, it's a simple matter of repeating the <label class="checkbox">
that wraps the <input type="checkbox">
.{{/i}}
{{_i}}Inline checkboxes and radios are also supported. Just add .inline
to any .checkbox
or .radio
and you're done.{{/i}}
{{_i}}To use prepend or append inputs in an inline form, be sure to place the .add-on
and input
on the same line, without spaces.{{/i}}
{{_i}}To add help text for your form inputs, include inline help text with <span class="help-inline">
or a help text block with <p class="help-block">
after the input element.{{/i}}
{{_i}}Instead of making every icon an extra request, we've compiled them into a sprite—a bunch of images in one file that uses CSS to position the images with background-position
. This is the same method we use on Twitter.com and it has worked well for us.{{/i}}
{{_i}}All icons classes are prefixed with .icon-
for proper namespacing and scoping, much like our other components. This will help avoid conflicts with other tools.{{/i}}
{{_i}}Glyphicons has granted us use of the Halflings set in our open-source toolkit so long as we provide a link and credit here in the docs. Please consider doing the same in your projects.{{/i}}
{{_i}}Bootstrap uses an <i>
tag for all icons, but they have no case class—only a shared prefix. To use, place the following code just about anywhere:{{/i}}
<i class="icon-search"></i>
{{_i}}There are also styles available for inverted (white) icons, made ready with one extra class:{{/i}}
<i class="icon-search icon-white"></i>
{{_i}}There are 140 classes to choose from for your icons. Just add an <i>
tag with the right classes and you're set. You can find the full list in sprites.less or right here in this document.{{/i}}
{{_i}}Heads up!{{/i}}
{{_i}}When using beside strings of text, as in buttons or nav links, be sure to leave a space after the <i>
tag for proper spacing.{{/i}}
{{_i}}Icons are great, but where would one use them? Here are a few ideas:{{/i}}
{{_i}}Essentially, anywhere you can put an <i>
tag, you can put an icon.{{/i}}
{{_i}}Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.{{/i}}
{{_i}}Refresh{{/i}} {{_i}}Checkout{{/i}} {{_i}}Delete{{/i}}
{{_i}}Comment{{/i}} {{_i}}Settings{{/i}} {{_i}}More Info{{/i}}