{{_i}}Fundamental HTML elements styled and enhanced with extensible classes.{{/i}}
{{_i}}All HTML headings, <h1>
through <h6>
are available.{{/i}}
{{_i}}Bootstrap's global default font-size
is 14px, with a line-height
of 20px. This is applied to the <body>
and all paragraphs. In addition, <p>
(paragraphs) receive a bottom margin of half their line-height (10px 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.
<p>...</p>{{! Body copy .lead }}
{{_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.
<p class="lead">...</p>{{! Using LESS }}
{{_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 with lightweight styles.{{/i}}
<small>
{{_i}}For de-emphasizing inline or blocks of text, use the small tag.{{/i}}
This line of text is meant to be treated as fine print.
<p> <small>This line of text is meant to be treated as fine print.</small> </p>
{{_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>
{{_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}}Convey meaning through color with a handful of emphasis utility classes.{{/i}}
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
<p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p> <p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p> <p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p> <p class="text-info">Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.</p> <p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
{{_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="HyperText Markup Language" class="initialism">HTML</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-right
for a floated, right-aligned blockquote.{{/i}}
<blockquote class="pull-right"> ... </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>
.
<section>
should be wrapped as inline.
{{_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}}Heads up!{{/i}} {{_i}}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-hover{{/i}}
{{_i}}Enable a hover state on table rows within a <tbody>
.{{/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-hover"> … </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}}Use contextual classes to color table rows.{{/i}}
{{_i}}Class{{/i}} | {{_i}}Description{{/i}} |
---|---|
.success
|
{{_i}}Indicates a successful or positive action.{{/i}} |
.error
|
{{_i}}Indicates a dangerous or potentially negative action.{{/i}} |
.warning
|
{{_i}}Indicates a warning that might need attention.{{/i}} |
.info
|
{{_i}}Used as an alternative to the default styles.{{/i}} |
# | {{_i}}Product{{/i}} | {{_i}}Payment Taken{{/i}} | {{_i}}Status{{/i}} |
---|---|---|---|
1 | TB - Monthly | 01/04/2012 | Approved |
2 | TB - Monthly | 02/04/2012 | Declined |
3 | TB - Monthly | 03/04/2012 | Pending |
4 | TB - Monthly | 04/04/2012 | Call in to confirm |
... <tr class="success"> <td>1</td> <td>TB - Monthly</td> <td>01/04/2012</td> <td>Approved</td> </tr> ...
{{_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> <caption>...</caption> <thead> <tr> <th>...</th> <th>...</th> </tr> </thead> <tbody> <tr> <td>...</td> <td>...</td> </tr> </tbody> </table>
{{_i}}Individual form controls receive styling, but without any required base class on the <form>
or large changes in markup. Results in stacked, left-aligned labels on top of form controls.{{/i}}
<form> <legend>{{_i}}Legend{{/i}}</legend> <label>{{_i}}Label name{{/i}}</label> <input type="text" 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}}Included with Bootstrap are three optional form layouts for common use cases.{{/i}}
{{_i}}Add .form-search
to the form and .search-query
to the <input>
for an extra-rounded text input.{{/i}}
<form class="form-search"> <input type="text" class="input-medium search-query"> <button type="submit" class="btn">{{_i}}Search{{/i}}</button> </form>
{{_i}}Add .form-inline
for left-aligned labels and inline-block controls for a compact layout.{{/i}}
<form class="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}}Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup changes from a default form:{{/i}}
.form-horizontal
to the form{{/i}}.control-group
{{/i}}.control-label
to the label{{/i}}.controls
for proper alignment{{/i}}<form class="form-horizontal"> <div class="control-group"> <label class="control-label" for="inputEmail">{{_i}}Email{{/i}}</label> <div class="controls"> <input type="text" id="inputEmail" placeholder="{{_i}}Email{{/i}}"> </div> </div> <div class="control-group"> <label class="control-label" for="inputPassword">{{_i}}Password{{/i}}</label> <div class="controls"> <input type="password" id="inputPassword" placeholder="{{_i}}Password{{/i}}"> </div> </div> <div class="control-group"> <div class="controls"> <label class="checkbox"> <input type="checkbox"> {{_i}}Remember me{{/i}} </label> <button type="submit" class="btn">{{_i}}Sign in{{/i}}</button> </div> </div> </form>
{{_i}}Examples of standard form controls supported in an example form layout.{{/i}}
{{_i}}Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.{{/i}}
{{_i}}Requires the use of a specified type
at all times.{{/i}}
<input type="text" placeholder="Text input">
{{_i}}Form control which supports multiple lines of text. Change rows
attribute as necessary.{{/i}}
<textarea rows="3"></textarea>
{{_i}}Checkboxes are for selecting one or several options in a list while radios are for selecting one option from many.{{/i}}
<label class="checkbox"> <input type="checkbox" value=""> {{_i}}Option one is this and that—be sure to include why it's great{{/i}} </label> <label class="radio"> <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked> {{_i}}Option one is this and that—be sure to include why it's great{{/i}} </label> <label class="radio"> <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2"> {{_i}}Option two can be something else and selecting it will deselect option one{{/i}} </label>
{{_i}}Add the .inline
class to a series of checkboxes or radios for controls appear on the same line.{{/i}}
<label class="checkbox inline"> <input type="checkbox" id="inlineCheckbox1" value="option1"> 1 </label> <label class="checkbox inline"> <input type="checkbox" id="inlineCheckbox2" value="option2"> 2 </label> <label class="checkbox inline"> <input type="checkbox" id="inlineCheckbox3" value="option3"> 3 </label>
{{_i}}Use the default option or specify a multiple="multiple"
to show multiple options at once.{{/i}}
<select> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> <select multiple="multiple"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select>
{{_i}}Adding on top of existing browser controls, Bootstrap includes other useful form components.{{/i}}
{{_i}}Add text or buttons before or after any text-based input. Do note that select
elements are not supported here.{{/i}}
{{_i}}Wrap an .add-on
and an input
with one of two classes to prepend or append text to an input.{{/i}}
<div class="input-prepend"> <span class="add-on">@</span><input class="span2" id="prependedInput" size="16" type="text" placeholder="{{_i}}Username{{/i}}"> </div> <div class="input-append"> <input class="span2" id="appendedInput" size="16" type="text"><span class="add-on">.00</span> </div>
{{_i}}Use both classes and two instances of .add-on
to prepend and append an input.{{/i}}
<div class="input-prepend input-append"> <span class="add-on">$</span><input class="span2" id="appendedPrependedInput" size="16" type="text"><span class="add-on">.00</span> </div>
{{_i}}Instead of a <span>
with text, use a .btn
to attach a button (or two) to an input.{{/i}}
<div class="input-append"> <input class="span2" id="appendedInputButton" size="16" type="text"><button class="btn" type="button">Go!</button> </div> <div class="input-append"> <input class="span2" id="appendedInputButtons" size="16" type="text"><button class="btn" type="button">Search</button><button class="btn" type="button">Options</button> </div>
<form class="form-search"> <div class="input-append"> <input type="text" class="span2 search-query"> <button type="submit" class="btn">{{_i}}Search{{/i}}</button> </div> <div class="input-prepend"> <button type="submit" class="btn">{{_i}}Search{{/i}}</button> <input type="text" class="span2 search-query"> </div> </form>
{{_i}}Use relative sizing classes like .input-large
or match your inputs to the grid column sizes using .span*
classes.{{/i}}
<input class="input-mini" type="text" placeholder=".input-mini"> <input class="input-small" type="text" placeholder=".input-small"> <input class="input-medium" type="text" placeholder=".input-medium"> <input class="input-large" type="text" placeholder=".input-large"> <input class="input-xlarge" type="text" placeholder=".input-xlarge"> <input class="input-xxlarge" type="text" placeholder=".input-xxlarge">
{{_i}}Heads up!{{/i}} In future versions, we'll be altering the use of these relative input classes to match our button sizes. For example, .input-large
will increase the padding and font-size of an input.
{{_i}}Use .span1
to .span12
for inputs that match the same sizes of the grid columns.{{/i}}
<input class="span1" type="text" placeholder=".span1"> <input class="span2" type="text" placeholder=".span2"> <input class="span3" type="text" placeholder=".span3"> <select class="span1"> ... </select> <select class="span2"> ... </select> <select class="span3"> ... </select>
{{_i}}For multiple grid inputs per line, use the .controls-row
modifier class for proper spacing. It floats the inputs to collapse white-space, sets the proper margins, and the clears the float.{{/i}}
<div class="controls"> <input class="span5" type="text" placeholder=".span5"> </div> <div class="controls controls-row"> <input class="span4" type="text" placeholder=".span4"> <input class="span1" type="text" placeholder=".span1"> </div> ...
{{_i}}Present data in a form that's not editable without using actual form markup.{{/i}}
<span class="input-xlarge uneditable-input">Some value here</span>
{{_i}}End a form with a group of actions (buttons). When placed within a .form-horizontal
, the buttons will automatically indent to line up with the form controls.{{/i}}
<div class="form-actions"> <button type="submit" class="btn btn-primary">{{_i}}Save changes{{/i}}</button> <button type="button" class="btn">{{_i}}Cancel{{/i}}</button> </div>
{{_i}}Inline and block level support for help text that appears around form controls.{{/i}}
<input type="text"><span class="help-inline">Inline help text</span>
<input type="text"><span class="help-block">A longer block of help text that breaks onto a new line and may extend beyond one line.</span>
{{_i}}Provide feedback to users or visitors with basic feedback states on form controls and labels.{{/i}}
{{_i}}We remove the default outline
styles on some form controls and apply a box-shadow
in its place for :focus
.{{/i}}
<input class="input-xlarge" id="focusedInput" type="text" value="{{_i}}This is focused...{{/i}}">
{{_i}}Add the disabled
attribute on an input to prevent user input and trigger a slightly different look.{{/i}}
<input class="input-xlarge" id="disabledInput" type="text" placeholder="{{_i}}Disabled input here...{{/i}}" disabled>
{{_i}}Bootstrap includes validation styles for error, warning, info, and success messages. To use, add the appropriate class to the surrounding .control-group
.{{/i}}
<div class="control-group warning"> <label class="control-label" for="inputWarning">{{_i}}Input with warning{{/i}}</label> <div class="controls"> <input type="text" id="inputWarning"> <span class="help-inline">{{_i}}Something may have gone wrong{{/i}}</span> </div> </div> <div class="control-group error"> <label class="control-label" for="inputError">{{_i}}Input with error{{/i}}</label> <div class="controls"> <input type="text" id="inputError"> <span class="help-inline">{{_i}}Please correct the error{{/i}}</span> </div> </div> <div class="control-group success"> <label class="control-label" for="inputSuccess">{{_i}}Input with success{{/i}}</label> <div class="controls"> <input type="text" id="inputSuccess"> <span class="help-inline">{{_i}}Woohoo!{{/i}}</span> </div> </div>
{{_i}}Add classes to an <img>
element to easily style images in any project.{{/i}}
<img src="..." class="img-rounded"> <img src="..." class="img-circle"> <img src="..." class="img-polaroid">
{{_i}}Heads up!{{/i}} {{_i}}.img-rounded
and .img-circle
do not work in IE7-8 due to lack of border-radius
support.{{/i}}
{{_i}}140 icons in sprite form, available in dark gray (default) and white, provided by Glyphicons.{{/i}}
{{_i}}Glyphicons Halflings are normally not available for free, but an arrangement between Bootstrap and the Glyphicons creators have made this possible at no cost to you as developers. As a thank you, we ask you to include an optional link back to Glyphicons whenever practical.{{/i}}
{{_i}}All icons require an <i>
tag with a unique class, prefixed with icon-
. 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. We will specifically enforce this class on hover and active states for nav and dropdown links.{{/i}}
<i class="icon-search icon-white"></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}}Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.{{/i}}
<div class="btn-toolbar"> <div class="btn-group"> <a class="btn" href="#"><i class="icon-align-left"></i></a> <a class="btn" href="#"><i class="icon-align-center"></i></a> <a class="btn" href="#"><i class="icon-align-right"></i></a> <a class="btn" href="#"><i class="icon-align-justify"></i></a> </div> </div>
<div class="btn-group"> <a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i> {{_i}}User{{/i}}</a> <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#"><i class="icon-pencil"></i> {{_i}}Edit{{/i}}</a></li> <li><a href="#"><i class="icon-trash"></i> {{_i}}Delete{{/i}}</a></li> <li><a href="#"><i class="icon-ban-circle"></i> {{_i}}Ban{{/i}}</a></li> <li class="divider"></li> <li><a href="#"><i class="i"></i> {{_i}}Make admin{{/i}}</a></li> </ul> </div>
<a class="btn btn-small" href="#"><i class="icon-star"></i></a>
<ul class="nav nav-list"> <li class="active"><a href="#"><i class="icon-home icon-white"></i> {{_i}}Home{{/i}}</a></li> <li><a href="#"><i class="icon-book"></i> {{_i}}Library{{/i}}</a></li> <li><a href="#"><i class="icon-pencil"></i> {{_i}}Applications{{/i}}</a></li> <li><a href="#"><i class="i"></i> {{_i}}Misc{{/i}}</a></li> </ul>
<div class="control-group"> <label class="control-label" for="inputIcon">{{_i}}Email address{{/i}}</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-envelope"></i></span> <input class="span2" id="inputIcon" type="text"> </div> </div> </div>