Headings

All HTML headings, <h1> through <h6>, are available. .h1 through .h6 classes are also available, for when you want to match the font styling of a heading but still want your text to be displayed inline.

h1. Bootstrap heading

Semibold 36px

h2. Bootstrap heading

Semibold 30px

h3. Bootstrap heading

Semibold 24px

h4. Bootstrap heading

Semibold 18px
h5. Bootstrap heading
Semibold 14px
h6. Bootstrap heading
Semibold 12px
<h1>h1. Bootstrap heading</h1>
      <h2>h2. Bootstrap heading</h2>
      <h3>h3. Bootstrap heading</h3>
      <h4>h4. Bootstrap heading</h4>
      <h5>h5. Bootstrap heading</h5>
      <h6>h6. Bootstrap heading</h6>
    

Create lighter, secondary text in any heading with a generic <small> tag or the .small class.

h1. Bootstrap heading Secondary text

h2. Bootstrap heading Secondary text

h3. Bootstrap heading Secondary text

h4. Bootstrap heading Secondary text

h5. Bootstrap heading Secondary text
h6. Bootstrap heading Secondary text
<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
      <h2>h2. Bootstrap heading <small>Secondary text</small></h2>
      <h3>h3. Bootstrap heading <small>Secondary text</small></h3>
      <h4>h4. Bootstrap heading <small>Secondary text</small></h4>
      <h5>h5. Bootstrap heading <small>Secondary text</small></h5>
      <h6>h6. Bootstrap heading <small>Secondary text</small></h6>
    

Body copy

Bootstrap's global default font-size is 14px, with a line-height of 1.428. This is applied to the <body> and all paragraphs. In addition, <p> (paragraphs) receive a bottom margin of half their computed line-height (10px by default).

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>
    

Lead body copy

Make a paragraph stand out by adding .lead.

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.

<p class="lead">...</p>
    

Built with Less

The typographic scale is based on two LESS variables in variables.less: @font-size-base and @line-height-base. 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.

Emphasis

Make use of HTML's default emphasis tags with lightweight styles.

Small text

For de-emphasizing inline or blocks of text, use the <small> tag to set text at 85% the size of the parent. Heading elements receive their own font-size for nested <small> elements.

You may alternatively use an inline element with .small in place of any <small>

This line of text is meant to be treated as fine print.

<small>This line of text is meant to be treated as fine print.</small>
    

Bold

For emphasizing a snippet of text with a heavier font-weight.

The following snippet of text is rendered as bold text.

<strong>rendered as bold text</strong>
    

Italics

For emphasizing a snippet of text with italics.

The following snippet of text is rendered as italicized text.

<em>rendered as italicized text</em>
    

Alternate elements

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.

Alignment classes

Easily realign text to components with text alignment classes.

Left aligned text.

Center aligned text.

Right aligned text.

<p class="text-left">Left aligned text.</p>
      <p class="text-center">Center aligned text.</p>
      <p class="text-right">Right aligned text.</p>
    

Emphasis classes

Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

Nullam id dolor id nibh ultricies vehicula ut id elit.

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

Maecenas sed diam eget risus varius blandit sit amet non magna.

Etiam porta sem malesuada magna mollis euismod.

Donec ullamcorper nulla non metus auctor fringilla.

<p class="text-muted">...</p>
      <p class="text-primary">...</p>
      <p class="text-success">...</p>
      <p class="text-info">...</p>
      <p class="text-warning">...</p>
      <p class="text-danger">...</p>
    

Dealing with specificity

Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <span> with the class.

Abbreviations

Stylized implementation 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.

Basic abbreviation

For expanded text on long hover of an abbreviation, include the title attribute with the <abbr> element.

An abbreviation of the word attribute is attr.

<abbr title="attribute">attr</abbr>
    

Initialism

Add .initialism to an abbreviation for a slightly smaller font-size.

HTML is the best thing since sliced bread.

<abbr title="HyperText Markup Language" class="initialism">HTML</abbr>
    

Addresses

Present contact information for the nearest ancestor or the entire body of work. Preserve formatting by ending all lines with <br>.

Twitter, Inc.
795 Folsom Ave, Suite 600
San Francisco, CA 94107
P: (123) 456-7890
Full Name
first.last@example.com
<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>Full Name</strong><br>
      <a href="mailto:#">first.last@example.com</a>
      </address>
    

Blockquotes

For quoting blocks of content from another source within your document.

Default blockquote

Wrap <blockquote> around any HTML as the quote. For straight quotes, we recommend a <p>.

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>
    

Blockquote options

Style and content changes for simple variations on a standard <blockquote>.

Naming a source

Add <small> tag for identifying the source. Wrap the name of the source work in <cite>.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Someone famous in Source Title
<blockquote>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
      <small>Someone famous in <cite title="Source Title">Source Title</cite></small>
      </blockquote>
    

Alternate displays

Use .pull-right for a floated, right-aligned blockquote.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Someone famous in Source Title
<blockquote class="pull-right">
      ...
      </blockquote>
    

Lists

Unordered

A list of items in which the order does not explicitly matter.

  • Lorem ipsum dolor sit amet
  • Consectetur adipiscing elit
  • Integer molestie lorem at massa
  • Facilisis in pretium nisl aliquet
  • Nulla volutpat aliquam velit
    • Phasellus iaculis neque
    • Purus sodales ultricies
    • Vestibulum laoreet porttitor sem
    • Ac tristique libero volutpat at
  • Faucibus porta lacus fringilla vel
  • Aenean sit amet erat nunc
  • Eget porttitor lorem
<ul>
      <li>...</li>
      </ul>
    

Ordered

A list of items in which the order does explicitly matter.

  1. Lorem ipsum dolor sit amet
  2. Consectetur adipiscing elit
  3. Integer molestie lorem at massa
  4. Facilisis in pretium nisl aliquet
  5. Nulla volutpat aliquam velit
  6. Faucibus porta lacus fringilla vel
  7. Aenean sit amet erat nunc
  8. Eget porttitor lorem
<ol>
      <li>...</li>
      </ol>
    

Unstyled

Remove the default list-style and left margin on list items (immediate children only). This only applies to immediate children list items, meaning you will need to add the class for any nested lists as well.

  • Lorem ipsum dolor sit amet
  • Consectetur adipiscing elit
  • Integer molestie lorem at massa
  • Facilisis in pretium nisl aliquet
  • Nulla volutpat aliquam velit
    • Phasellus iaculis neque
    • Purus sodales ultricies
    • Vestibulum laoreet porttitor sem
    • Ac tristique libero volutpat at
  • Faucibus porta lacus fringilla vel
  • Aenean sit amet erat nunc
  • Eget porttitor lorem
<ul class="list-unstyled">
      <li>...</li>
      </ul>
    

Inline

Place all list items on a single line with display: inline-block; and some light padding.

  • Lorem ipsum
  • Phasellus iaculis
  • Nulla volutpat
<ul class="list-inline">
      <li>...</li>
      </ul>
    

Description

A list of terms with their associated descriptions.

Description lists
A description list is perfect for defining terms.
Euismod
Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
Donec id elit non mi porta gravida at eget metus.
Malesuada porta
Etiam porta sem malesuada magna mollis euismod.
<dl>
      <dt>...</dt>
      <dd>...</dd>
      </dl>
    

Horizontal description

Make terms and descriptions in <dl> line up side-by-side. Starts off stacked like default <dl>s, but when the navbar expands, so do these.

Description lists
A description list is perfect for defining terms.
Euismod
Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
Donec id elit non mi porta gravida at eget metus.
Malesuada porta
Etiam porta sem malesuada magna mollis euismod.
Felis euismod semper eget lacinia
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
<dl class="dl-horizontal">
      <dt>...</dt>
      <dd>...</dd>
      </dl>
    

Auto-truncating

Horizontal description lists will truncate terms that are too long to fit in the left column with text-overflow. In narrower viewports, they will change to the default stacked layout.

Inline

Wrap inline snippets of code with <code>.

For example, <section> should be wrapped as inline.
For example, <code>&lt;section&gt;</code> should be wrapped as inline.
        

Basic block

Use <pre> for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.

<p>Sample text here...</p>
<pre>&lt;p&gt;Sample text here...&lt;/p&gt;</pre>
        

You may optionally add the .pre-scrollable class, which will set a max-height of 350px and provide a y-axis scrollbar.

Basic example

For basic styling—light padding and only horizontal dividers—add the base class .table to any <table>. It may seem super redundant, but given the widespread use of tables for other plugins like calendars and date pickers, we've opted to isolate our custom table styles.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
<table class="table">
      ...
      </table>
    

Striped rows

Use .table-striped to add zebra-striping to any table row within the <tbody>.

Cross-browser compatibility

Striped tables are styled via the :nth-child CSS selector, which is not available in Internet Explorer 8.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
<table class="table table-striped">
      ...
      </table>
    

Bordered table

Add .table-bordered for borders on all sides of the table and cells.

# First Name Last Name Username
1 Mark Otto @mdo
Mark Otto @TwBootstrap
2 Jacob Thornton @fat
3 Larry the Bird @twitter
<table class="table table-bordered">
      ...
      </table>
    

Hover rows

Add .table-hover to enable a hover state on table rows within a <tbody>.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
<table class="table table-hover">
      ...
      </table>
    

Condensed table

Add .table-condensed to make tables more compact by cutting cell padding in half.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
<table class="table table-condensed">
      ...
      </table>
    

Contextual classes

Use contextual classes to color table rows or individual cells.

Class Description
.active Applies the hover color to a particular row or cell
.success Indicates a successful or positive action
.warning Indicates a warning that might need attention
.danger Indicates a dangerous or potentially negative action
# Column heading Column heading Column heading
1 Column content Column content Column content
2 Column content Column content Column content
3 Column content Column content Column content
4 Column content Column content Column content
5 Column content Column content Column content
6 Column content Column content Column content
7 Column content Column content Column content
<!-- On rows -->
      <tr class="active">...</tr>
      <tr class="success">...</tr>
      <tr class="warning">...</tr>
      <tr class="danger">...</tr>

      <!-- On cells (`td` or `th`) -->
      <tr>
      <td class="active">...</td>
      <td class="success">...</td>
      <td class="warning">...</td>
      <td class="danger">...</td>
      </tr>
    

Responsive tables

Create responsive tables by wrapping any .table in .table-responsive to make them scroll horizontally up to small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.

# Table heading Table heading Table heading Table heading Table heading Table heading
1 Table cell Table cell Table cell Table cell Table cell Table cell
2 Table cell Table cell Table cell Table cell Table cell Table cell
3 Table cell Table cell Table cell Table cell Table cell Table cell
# Table heading Table heading Table heading Table heading Table heading Table heading
1 Table cell Table cell Table cell Table cell Table cell Table cell
2 Table cell Table cell Table cell Table cell Table cell Table cell
3 Table cell Table cell Table cell Table cell Table cell Table cell
<div class="table-responsive">
      <table class="table">
      ...
      </table>
      </div>
    

Basic example

Individual form controls automatically receive some global styling. All textual <input>, <textarea>, and <select> elements with .form-control are set to width: 100%; by default. Wrap labels and controls in .form-group for optimum spacing.

Example block-level help text here.

<form role="form">
      <div class="form-group">
      <label for="exampleInputEmail1">Email address</label>
      <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
      </div>
      <div class="form-group">
      <label for="exampleInputPassword1">Password</label>
      <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
      </div>
      <div class="form-group">
      <label for="exampleInputFile">File input</label>
      <input type="file" id="exampleInputFile">
      <p class="help-block">Example block-level help text here.</p>
      </div>
      <div class="checkbox">
      <label>
      <input type="checkbox"> Check me out
      </label>
      </div>
      <button type="submit" class="btn btn-default">Submit</button>
      </form>
    

Inline form

Add .form-inline for left-aligned and inline-block controls for a compact layout.

Requires custom widths

Inputs, selects, and textareas are 100% wide by default in Bootstrap. To use the inline form, you'll have to set a width on the form controls used within.

Always add labels

Screen readers will have trouble with your forms if you don't include a label for every input. For these inline forms, you can hide the labels using the .sr-only class.

<form class="form-inline" role="form">
      <div class="form-group">
      <label class="sr-only" for="exampleInputEmail2">Email address</label>
      <input type="email" class="form-control" id="exampleInputEmail2" placeholder="Enter email">
      </div>
      <div class="form-group">
      <label class="sr-only" for="exampleInputPassword2">Password</label>
      <input type="password" class="form-control" id="exampleInputPassword2" placeholder="Password">
      </div>
      <div class="checkbox">
      <label>
      <input type="checkbox"> Remember me
      </label>
      </div>
      <button type="submit" class="btn btn-default">Sign in</button>
      </form>
    

Horizontal form

Use Bootstrap's predefined grid classes to align labels and groups of form controls in a horizontal layout by adding .form-horizontal to the form. Doing so changes .form-groups to behave as grid rows, so no need for .row.

<form class="form-horizontal" role="form">
      <div class="form-group">
      <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
      <div class="col-sm-10">
      <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
      </div>
      </div>
      <div class="form-group">
      <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
      <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
      </div>
      </div>
      <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
      <label>
      <input type="checkbox"> Remember me
      </label>
      </div>
      </div>
      </div>
      <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">Sign in</button>
      </div>
      </div>
      </form>
    

Supported controls

Examples of standard form controls supported in an example form layout.

Inputs

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.

Type declaration required

Inputs will only be fully styled if their type is properly declared.

<input type="text" class="form-control" placeholder="Text input">
    

Input groups

To add integrated text or buttons before and/or after any text-based <input>, check out the input group component.

Textarea

Form control which supports multiple lines of text. Change rows attribute as necessary.

<textarea class="form-control" rows="3"></textarea>
    

Checkboxes and radios

Checkboxes are for selecting one or several options in a list while radios are for selecting one option from many.

Default (stacked)


<div class="checkbox">
      <label>
      <input type="checkbox" value="">
      Option one is this and that&mdash;be sure to include why it's great
      </label>
      </div>

      <div class="radio">
      <label>
      <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
      Option one is this and that&mdash;be sure to include why it's great
      </label>
      </div>
      <div class="radio">
      <label>
      <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
      Option two can be something else and selecting it will deselect option one
      </label>
      </div>
    

Inline checkboxes

Use .checkbox-inline or .radio-inline class to a series of checkboxes or radios for controls appear on the same line.

<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>
    

Selects

Use the default option, or add multiple to show multiple options at once.


<select class="form-control">
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
      <option>5</option>
      </select>

      <select multiple class="form-control">
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
      <option>5</option>
      </select>
    

Static control

When you need to place plain text next to a form label within a horizontal form, use the .form-control-static class on a <p>.

email@example.com

<form class="form-horizontal" role="form">
      <div class="form-group">
      <label class="col-sm-2 control-label">Email</label>
      <div class="col-sm-10">
      <p class="form-control-static">email@example.com</p>
      </div>
      </div>
      <div class="form-group">
      <label for="inputPassword" class="col-sm-2 control-label">Password</label>
      <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword" placeholder="Password">
      </div>
      </div>
      </form>
    

Form states

Provide feedback to users or visitors with basic feedback states on form controls and labels.

Input focus

We remove the default outline styles on some form controls and apply a box-shadow in its place for :focus.

<input class="form-control" id="focusedInput" type="text" value="This is focused...">
    

Disabled inputs

Add the disabled attribute on an input to prevent user input and trigger a slightly different look.

<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>
    

Disabled fieldsets

Add the disabled attribute to a <fieldset> to disable all the controls within the <fieldset> at once.

Link functionality of <a> not impacted

This class will only change the appearance of <a class="btn btn-default"> buttons, not their functionality. Use custom JavaScript to disable links here.

Cross-browser compatibility

While Bootstrap will apply these styles in all browsers, Internet Explorer 9 and below don't actually support the disabled attribute on a <fieldset>. Use custom JavaScript to disable the fieldset in these browsers.

<form role="form">
      <fieldset disabled>
      <div class="form-group">
      <label for="disabledTextInput">Disabled input</label>
      <input type="text" id="disabledTextInput" class="form-control" placeholder="Disabled input">
      </div>
      <div class="form-group">
      <label for="disabledSelect">Disabled select menu</label>
      <select id="disabledSelect" class="form-control">
      <option>Disabled select</option>
      </select>
      </div>
      <div class="checkbox">
      <label>
      <input type="checkbox"> Can't check this
      </label>
      </div>
      <button type="submit" class="btn btn-primary">Submit</button>
      </fieldset>
      </form>
    

Validation states

Bootstrap includes validation styles for error, warning, and success states on form controls. To use, add .has-warning, .has-error, or .has-success to the parent element. Any .control-label, .form-control, and .help-block within that element will receive the validation styles.

<div class="form-group has-success">
      <label class="control-label" for="inputSuccess">Input with success</label>
      <input type="text" class="form-control" id="inputSuccess">
      </div>
      <div class="form-group has-warning">
      <label class="control-label" for="inputWarning">Input with warning</label>
      <input type="text" class="form-control" id="inputWarning">
      </div>
      <div class="form-group has-error">
      <label class="control-label" for="inputError">Input with error</label>
      <input type="text" class="form-control" id="inputError">
      </div>
    

Control sizing

Set heights using classes like .input-lg, and set widths using grid column classes like .col-lg-*.

Height sizing

Create larger or smaller form controls that match button sizes.

<input class="form-control input-lg" type="text" placeholder=".input-lg">
      <input class="form-control" type="text" placeholder="Default input">
      <input class="form-control input-sm" type="text" placeholder=".input-sm">

      <select class="form-control input-lg">...</select>
      <select class="form-control">...</select>
      <select class="form-control input-sm">...</select>
    

Column sizing

Wrap inputs in grid columns, or any custom parent element, to easily enforce desired widths.

<div class="row">
      <div class="col-xs-2">
      <input type="text" class="form-control" placeholder=".col-xs-2">
      </div>
      <div class="col-xs-3">
      <input type="text" class="form-control" placeholder=".col-xs-3">
      </div>
      <div class="col-xs-4">
      <input type="text" class="form-control" placeholder=".col-xs-4">
      </div>
      </div>
    

Help text

Block level help text for form controls.

A block of help text that breaks onto a new line and may extend beyond one line.
<span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
    

Options

Use any of the available button classes to quickly create a styled button.

<!-- Standard button -->
        <button type="button" class="btn btn-default">Default</button>

        <!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
        <button type="button" class="btn btn-primary">Primary</button>

        <!-- Indicates a successful or positive action -->
        <button type="button" class="btn btn-success">Success</button>

        <!-- Contextual button for informational alert messages -->
        <button type="button" class="btn btn-info">Info</button>

        <!-- Indicates caution should be taken with this action -->
        <button type="button" class="btn btn-warning">Warning</button>

        <!-- Indicates a dangerous or potentially negative action -->
        <button type="button" class="btn btn-danger">Danger</button>

        <!-- Deemphasize a button by making it look like a link while maintaining button behavior -->
        <button type="button" class="btn btn-link">Link</button>
      

Sizes

Fancy larger or smaller buttons? Add .btn-lg, .btn-sm, or .btn-xs for additional sizes.

<p>
        <button type="button" class="btn btn-primary btn-lg">Large button</button>
        <button type="button" class="btn btn-default btn-lg">Large button</button>
        </p>
        <p>
        <button type="button" class="btn btn-primary">Default button</button>
        <button type="button" class="btn btn-default">Default button</button>
        </p>
        <p>
        <button type="button" class="btn btn-primary btn-sm">Small button</button>
        <button type="button" class="btn btn-default btn-sm">Small button</button>
        </p>
        <p>
        <button type="button" class="btn btn-primary btn-xs">Extra small button</button>
        <button type="button" class="btn btn-default btn-xs">Extra small button</button>
        </p>
      

Create block level buttons—those that span the full width of a parent— by adding .btn-block.

<button type="button" class="btn btn-primary btn-lg btn-block">Block level button</button>
        <button type="button" class="btn btn-default btn-lg btn-block">Block level button</button>
      

Active state

Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <button> elements, this is done via :active. For <a> elements, it's done with .active. However, you may use .active <button>s should you need to replicate the active state progammatically.

Button element

No need to add :active as it's a pseudo-class, but if you need to force the same appearance, go ahead and add .active.

<button type="button" class="btn btn-primary btn-lg active">Primary button</button>
        <button type="button" class="btn btn-default btn-lg active">Button</button>
      

Anchor element

Add the .active class to <a> buttons.

Primary link Link

<a href="#" class="btn btn-primary btn-lg active" role="button">Primary link</a>
        <a href="#" class="btn btn-default btn-lg active" role="button">Link</a>
      

Disabled state

Make buttons look unclickable by fading them back 50%.

Button element

Add the disabled attribute to <button> buttons.

<button type="button" class="btn btn-lg btn-primary" disabled="disabled">Primary button</button>
        <button type="button" class="btn btn-default btn-lg" disabled="disabled">Button</button>
      

Cross-browser compatibility

If you add the disabled attribute to a <button>, Internet Explorer 9 and below will render text gray with a nasty text-shadow that we cannot fix.

Anchor element

Add the .disabled class to <a> buttons.

Primary link Link

<a href="#" class="btn btn-primary btn-lg disabled" role="button">Primary link</a>
        <a href="#" class="btn btn-default btn-lg disabled" role="button">Link</a>
      

We use .disabled as a utility class here, similar to the common .active class, so no prefix is required.

Link functionality not impacted

This class will only change the <a>'s appearance, not its functionality. Use custom JavaScript to disable links here.

Context-specific usage

While button classes can be used on <a> and <button> elements, only <button> elements are supported within our nav and navbar components.

Button tags

Use the button classes on an <a>, <button>, or <input> element.

Link
<a class="btn btn-default" href="#" role="button">Link</a>
        <button class="btn btn-default" type="submit">Button</button>
        <input class="btn btn-default" type="button" value="Input">
        <input class="btn btn-default" type="submit" value="Submit">
      

Cross-browser rendering

As a best practice, we highly recommend using the <button> element whenever possible to ensure matching cross-browser rendering.

Among other things, there's a Firefox bug that prevents us from setting the line-height of <input>-based buttons, causing them to not exactly match the height of other buttons on Firefox.

Add classes to an <img> element to easily style images in any project.

Cross-browser compatibility

Keep in mind that Internet Explorer 8 lacks support for rounded corners.

140x140 140x140 140x140
<img src="..." alt="..." class="img-rounded">
        <img src="..." alt="..." class="img-circle">
        <img src="..." alt="..." class="img-thumbnail">
      

Responsive images

Looking for how to make images more responsive? Check out the responsive images section up top.

Available glyphs

Includes 200 glyphs in font format from the Glyphicon Halflings set. Glyphicons Halflings are normally not available for free, but their creator has made them available for Bootstrap free of cost. As a thank you, we only ask that you to include a link back to Glyphicons whenever possible.

  • .glyphicon .glyphicon-adjust
  • .glyphicon .glyphicon-align-center
  • .glyphicon .glyphicon-align-justify
  • .glyphicon .glyphicon-align-left
  • .glyphicon .glyphicon-align-right
  • .glyphicon .glyphicon-arrow-down
  • .glyphicon .glyphicon-arrow-left
  • .glyphicon .glyphicon-arrow-right
  • .glyphicon .glyphicon-arrow-up
  • .glyphicon .glyphicon-asterisk
  • .glyphicon .glyphicon-backward
  • .glyphicon .glyphicon-ban-circle
  • .glyphicon .glyphicon-barcode
  • .glyphicon .glyphicon-bell
  • .glyphicon .glyphicon-bold
  • .glyphicon .glyphicon-book
  • .glyphicon .glyphicon-bookmark
  • .glyphicon .glyphicon-briefcase
  • .glyphicon .glyphicon-bullhorn
  • .glyphicon .glyphicon-calendar
  • .glyphicon .glyphicon-camera
  • .glyphicon .glyphicon-certificate
  • .glyphicon .glyphicon-check
  • .glyphicon .glyphicon-chevron-down
  • .glyphicon .glyphicon-chevron-left
  • .glyphicon .glyphicon-chevron-right
  • .glyphicon .glyphicon-chevron-up
  • .glyphicon .glyphicon-circle-arrow-down
  • .glyphicon .glyphicon-circle-arrow-left
  • .glyphicon .glyphicon-circle-arrow-right
  • .glyphicon .glyphicon-circle-arrow-up
  • .glyphicon .glyphicon-cloud
  • .glyphicon .glyphicon-cloud-download
  • .glyphicon .glyphicon-cloud-upload
  • .glyphicon .glyphicon-cog
  • .glyphicon .glyphicon-collapse-down
  • .glyphicon .glyphicon-collapse-up
  • .glyphicon .glyphicon-comment
  • .glyphicon .glyphicon-compressed
  • .glyphicon .glyphicon-copyright-mark
  • .glyphicon .glyphicon-credit-card
  • .glyphicon .glyphicon-cutlery
  • .glyphicon .glyphicon-dashboard
  • .glyphicon .glyphicon-download
  • .glyphicon .glyphicon-download-alt
  • .glyphicon .glyphicon-earphone
  • .glyphicon .glyphicon-edit
  • .glyphicon .glyphicon-eject
  • .glyphicon .glyphicon-envelope
  • .glyphicon .glyphicon-euro
  • .glyphicon .glyphicon-exclamation-sign
  • .glyphicon .glyphicon-expand
  • .glyphicon .glyphicon-export
  • .glyphicon .glyphicon-eye-close
  • .glyphicon .glyphicon-eye-open
  • .glyphicon .glyphicon-facetime-video
  • .glyphicon .glyphicon-fast-backward
  • .glyphicon .glyphicon-fast-forward
  • .glyphicon .glyphicon-file
  • .glyphicon .glyphicon-film
  • .glyphicon .glyphicon-filter
  • .glyphicon .glyphicon-fire
  • .glyphicon .glyphicon-flag
  • .glyphicon .glyphicon-flash
  • .glyphicon .glyphicon-floppy-disk
  • .glyphicon .glyphicon-floppy-open
  • .glyphicon .glyphicon-floppy-remove
  • .glyphicon .glyphicon-floppy-save
  • .glyphicon .glyphicon-floppy-saved
  • .glyphicon .glyphicon-folder-close
  • .glyphicon .glyphicon-folder-open
  • .glyphicon .glyphicon-font
  • .glyphicon .glyphicon-forward
  • .glyphicon .glyphicon-fullscreen
  • .glyphicon .glyphicon-gbp
  • .glyphicon .glyphicon-gift
  • .glyphicon .glyphicon-glass
  • .glyphicon .glyphicon-globe
  • .glyphicon .glyphicon-hand-down
  • .glyphicon .glyphicon-hand-left
  • .glyphicon .glyphicon-hand-right
  • .glyphicon .glyphicon-hand-up
  • .glyphicon .glyphicon-hd-video
  • .glyphicon .glyphicon-hdd
  • .glyphicon .glyphicon-header
  • .glyphicon .glyphicon-headphones
  • .glyphicon .glyphicon-heart
  • .glyphicon .glyphicon-heart-empty
  • .glyphicon .glyphicon-home
  • .glyphicon .glyphicon-import
  • .glyphicon .glyphicon-inbox
  • .glyphicon .glyphicon-indent-left
  • .glyphicon .glyphicon-indent-right
  • .glyphicon .glyphicon-info-sign
  • .glyphicon .glyphicon-italic
  • .glyphicon .glyphicon-leaf
  • .glyphicon .glyphicon-link
  • .glyphicon .glyphicon-list
  • .glyphicon .glyphicon-list-alt
  • .glyphicon .glyphicon-lock
  • .glyphicon .glyphicon-log-in
  • .glyphicon .glyphicon-log-out
  • .glyphicon .glyphicon-magnet
  • .glyphicon .glyphicon-map-marker
  • .glyphicon .glyphicon-minus
  • .glyphicon .glyphicon-minus-sign
  • .glyphicon .glyphicon-move
  • .glyphicon .glyphicon-music
  • .glyphicon .glyphicon-new-window
  • .glyphicon .glyphicon-off
  • .glyphicon .glyphicon-ok
  • .glyphicon .glyphicon-ok-circle
  • .glyphicon .glyphicon-ok-sign
  • .glyphicon .glyphicon-open
  • .glyphicon .glyphicon-paperclip
  • .glyphicon .glyphicon-pause
  • .glyphicon .glyphicon-pencil
  • .glyphicon .glyphicon-phone
  • .glyphicon .glyphicon-phone-alt
  • .glyphicon .glyphicon-picture
  • .glyphicon .glyphicon-plane
  • .glyphicon .glyphicon-play
  • .glyphicon .glyphicon-play-circle
  • .glyphicon .glyphicon-plus
  • .glyphicon .glyphicon-plus-sign
  • .glyphicon .glyphicon-print
  • .glyphicon .glyphicon-pushpin
  • .glyphicon .glyphicon-qrcode
  • .glyphicon .glyphicon-question-sign
  • .glyphicon .glyphicon-random
  • .glyphicon .glyphicon-record
  • .glyphicon .glyphicon-refresh
  • .glyphicon .glyphicon-registration-mark
  • .glyphicon .glyphicon-remove
  • .glyphicon .glyphicon-remove-circle
  • .glyphicon .glyphicon-remove-sign
  • .glyphicon .glyphicon-repeat
  • .glyphicon .glyphicon-resize-full
  • .glyphicon .glyphicon-resize-horizontal
  • .glyphicon .glyphicon-resize-small
  • .glyphicon .glyphicon-resize-vertical
  • .glyphicon .glyphicon-retweet
  • .glyphicon .glyphicon-road
  • .glyphicon .glyphicon-save
  • .glyphicon .glyphicon-saved
  • .glyphicon .glyphicon-screenshot
  • .glyphicon .glyphicon-sd-video
  • .glyphicon .glyphicon-search
  • .glyphicon .glyphicon-send
  • .glyphicon .glyphicon-share
  • .glyphicon .glyphicon-share-alt
  • .glyphicon .glyphicon-shopping-cart
  • .glyphicon .glyphicon-signal
  • .glyphicon .glyphicon-sort
  • .glyphicon .glyphicon-sort-by-alphabet
  • .glyphicon .glyphicon-sort-by-alphabet-alt
  • .glyphicon .glyphicon-sort-by-attributes
  • .glyphicon .glyphicon-sort-by-attributes-alt
  • .glyphicon .glyphicon-sort-by-order
  • .glyphicon .glyphicon-sort-by-order-alt
  • .glyphicon .glyphicon-sound-5-1
  • .glyphicon .glyphicon-sound-6-1
  • .glyphicon .glyphicon-sound-7-1
  • .glyphicon .glyphicon-sound-dolby
  • .glyphicon .glyphicon-sound-stereo
  • .glyphicon .glyphicon-star
  • .glyphicon .glyphicon-star-empty
  • .glyphicon .glyphicon-stats
  • .glyphicon .glyphicon-step-backward
  • .glyphicon .glyphicon-step-forward
  • .glyphicon .glyphicon-stop
  • .glyphicon .glyphicon-subtitles
  • .glyphicon .glyphicon-tag
  • .glyphicon .glyphicon-tags
  • .glyphicon .glyphicon-tasks
  • .glyphicon .glyphicon-text-height
  • .glyphicon .glyphicon-text-width
  • .glyphicon .glyphicon-th
  • .glyphicon .glyphicon-th-large
  • .glyphicon .glyphicon-th-list
  • .glyphicon .glyphicon-thumbs-down
  • .glyphicon .glyphicon-thumbs-up
  • .glyphicon .glyphicon-time
  • .glyphicon .glyphicon-tint
  • .glyphicon .glyphicon-tower
  • .glyphicon .glyphicon-transfer
  • .glyphicon .glyphicon-trash
  • .glyphicon .glyphicon-tree-conifer
  • .glyphicon .glyphicon-tree-deciduous
  • .glyphicon .glyphicon-unchecked
  • .glyphicon .glyphicon-upload
  • .glyphicon .glyphicon-usd
  • .glyphicon .glyphicon-user
  • .glyphicon .glyphicon-volume-down
  • .glyphicon .glyphicon-volume-off
  • .glyphicon .glyphicon-volume-up
  • .glyphicon .glyphicon-warning-sign
  • .glyphicon .glyphicon-wrench
  • .glyphicon .glyphicon-zoom-in
  • .glyphicon .glyphicon-zoom-out

How to use

For performance reasons, all icons require a base class and individual icon class. To use, place the following code just about anywhere. Be sure to leave a space between the icon and text for proper padding.

<span class="glyphicon glyphicon-search"></span>
    

Examples

Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.

<button type="button" class="btn btn-default btn-lg">
      <span class="glyphicon glyphicon-star"></span> Star
      </button>
    

Toggleable, contextual menu for displaying lists of links. Made interactive with the dropdown JavaScript plugin.

Wrap the dropdown's trigger and the dropdown menu within .dropdown, or another element that declares position: relative;. Then add the menu's HTML.

<div class="dropdown">
        <button class="btn dropdown-toggle sr-only" type="button" id="dropdownMenu1" data-toggle="dropdown">
        Dropdown
        <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
        <li role="presentation" class="divider"></li>
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
        </ul>
        </div>
      

Add .pull-right to a .dropdown-menu to right align the dropdown menu.

<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel">
        ...
        </ul>
      

Add a header to label sections of actions in any dropdown menu.

<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2">
        <li role="presentation" class="dropdown-header">Dropdown header</li>
        ...
        <li role="presentation" class="divider"></li>
        <li role="presentation" class="dropdown-header">Dropdown header</li>
        ...
        </ul>
      

Add .disabled to a <li> in the dropdown to disable the link.

<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu3">
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Regular link</a></li>
        <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#">Disabled link</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another link</a></li>
        </ul>
      

Group a series of buttons together on a single line with the button group. Add on optional JavaScript radio and checkbox style behavior with our buttons plugin.

Tooltips & popovers in button groups require special setting

When using tooltips or popovers on elements within a .btn-group, you'll have to specify the option container: 'body' to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).

Basic example

Wrap a series of buttons with .btn in .btn-group.

<div class="btn-group">
      <button type="button" class="btn btn-default">Left</button>
      <button type="button" class="btn btn-default">Middle</button>
      <button type="button" class="btn btn-default">Right</button>
      </div>
    

Button toolbar

Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.

<div class="btn-toolbar" role="toolbar">
      <div class="btn-group">...</div>
      <div class="btn-group">...</div>
      <div class="btn-group">...</div>
      </div>
    

Sizing

Instead of applying button sizing classes to every button in a group, just add .btn-group-* to the .btn-group.

<div class="btn-group btn-group-lg">...</div>
      <div class="btn-group">...</div>
      <div class="btn-group btn-group-sm">...</div>
      <div class="btn-group btn-group-xs">...</div>
    

Nesting

Place a .btn-group within another .btn-group when you want dropdown menus mixed with a series of buttons.

<div class="btn-group">
      <button type="button" class="btn btn-default">1</button>
      <button type="button" class="btn btn-default">2</button>

      <div class="btn-group">
      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
      Dropdown
      <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
      <li><a href="#">Dropdown link</a></li>
      <li><a href="#">Dropdown link</a></li>
      </ul>
      </div>
      </div>
    

Vertical variation

Make a set of buttons appear vertically stacked rather than horizontally.

<div class="btn-group-vertical">
      ...
      </div>
    

Justified link variation

Make a group of buttons stretch at the same size to span the entire width of its parent.

Element-specific usage

This only works with <a> elements as the <button> doesn't pick up these styles.

<div class="btn-group btn-group-justified">
      ...
      </div>
    

Use any button to trigger a dropdown menu by placing it within a .btn-group and providing the proper menu markup.

Plugin dependency

Button dropdowns require the dropdown plugin to be included in your version of Bootstrap.

Single button dropdowns

Turn a button into a dropdown toggle with some basic markup changes.

<!-- Single button -->
      <div class="btn-group">
      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
      Action <span class="caret"></span>
      </button>
      <ul class="dropdown-menu" role="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>
      </div>
    

Split button dropdowns

Similarly, create split button dropdowns with the same markup changes, only with a separate button.

<!-- Split button -->
      <div class="btn-group">
      <button type="button" class="btn btn-danger">Action</button>
      <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
      <span class="caret"></span>
      <span class="sr-only">Toggle Dropdown</span>
      </button>
      <ul class="dropdown-menu" role="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>
      </div>
    

Sizing

Button dropdowns work with buttons of all sizes.

<!-- Large button group -->
      <div class="btn-group">
      <button class="btn btn-default btn-lg dropdown-toggle" type="button" data-toggle="dropdown">
      Large button <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
      ...
      </ul>
      </div>

      <!-- Small button group -->
      <div class="btn-group">
      <button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown">
      Small button <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
      ...
      </ul>
      </div>

      <!-- Extra small button group -->
      <div class="btn-group">
      <button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown">
      Extra small button <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
      ...
      </ul>
      </div>
    

Dropup variation

Trigger dropdown menus above elements by adding .dropup to the parent.

<div class="btn-group dropup">
      <button type="button" class="btn btn-default">Dropup</button>
      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
      <span class="caret"></span>
      <span class="sr-only">Toggle Dropdown</span>
      </button>
      <ul class="dropdown-menu">
      <!-- Dropdown menu links -->
      </ul>
      </div>
    

Extend form controls by adding text or buttons before, after, or on both sides of any text-based input. Use .input-group with an .input-group-addon to prepend or append elements to a .form-control.

Cross-browser compatibility

Avoid using <select> elements here as they cannot be fully styled in WebKit browsers.

Tooltips & popovers in input groups require special setting

When using tooltips or popovers on elements within an .input-group, you'll have to specify the option container: 'body' to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).

Don't mix with form groups

Do not apply input group classes directly to form groups. An input group is an isolated component.

Basic example

@

.00

$ .00
<div class="input-group">
      <span class="input-group-addon">@</span>
      <input type="text" class="form-control" placeholder="Username">
      </div>

      <div class="input-group">
      <input type="text" class="form-control">
      <span class="input-group-addon">.00</span>
      </div>

      <div class="input-group">
      <span class="input-group-addon">$</span>
      <input type="text" class="form-control">
      <span class="input-group-addon">.00</span>
      </div>
    

Sizing

Add the relative form sizing classes to the .input-group itself and contents within will automatically resize—no need for repeating the form control size classes on each element.

@

@

@
<div class="input-group input-group-lg">
      <span class="input-group-addon">@</span>
      <input type="text" class="form-control" placeholder="Username">
      </div>

      <div class="input-group">
      <span class="input-group-addon">@</span>
      <input type="text" class="form-control" placeholder="Username">
      </div>

      <div class="input-group input-group-sm">
      <span class="input-group-addon">@</span>
      <input type="text" class="form-control" placeholder="Username">
      </div>
    

Checkboxes and radio addons

Place any checkbox or radio option within an input group's addon instead of text.

<div class="row">
      <div class="col-lg-6">
      <div class="input-group">
      <span class="input-group-addon">
      <input type="checkbox">
      </span>
      <input type="text" class="form-control">
      </div><!-- /input-group -->
      </div><!-- /.col-lg-6 -->
      <div class="col-lg-6">
      <div class="input-group">
      <span class="input-group-addon">
      <input type="radio">
      </span>
      <input type="text" class="form-control">
      </div><!-- /input-group -->
      </div><!-- /.col-lg-6 -->
      </div><!-- /.row -->
    

Button addons

Buttons in input groups are a bit different and require one extra level of nesting. Instead of .input-group-addon, you'll need to use .input-group-btn to wrap the buttons. This is required due to default browser styles that cannot be overridden.

<div class="row">
      <div class="col-lg-6">
      <div class="input-group">
      <span class="input-group-btn">
      <button class="btn btn-default" type="button">Go!</button>
      </span>
      <input type="text" class="form-control">
      </div><!-- /input-group -->
      </div><!-- /.col-lg-6 -->
      <div class="col-lg-6">
      <div class="input-group">
      <input type="text" class="form-control">
      <span class="input-group-btn">
      <button class="btn btn-default" type="button">Go!</button>
      </span>
      </div><!-- /input-group -->
      </div><!-- /.col-lg-6 -->
      </div><!-- /.row -->
    

Buttons with dropdowns

<div class="row">
      <div class="col-lg-6">
      <div class="input-group">
      <div class="input-group-btn">
      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
      <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>
      </div><!-- /btn-group -->
      <input type="text" class="form-control">
      </div><!-- /input-group -->
      </div><!-- /.col-lg-6 -->
      <div class="col-lg-6">
      <div class="input-group">
      <input type="text" class="form-control">
      <div class="input-group-btn">
      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
      <ul class="dropdown-menu pull-right">
      <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>
      </div><!-- /btn-group -->
      </div><!-- /input-group -->
      </div><!-- /.col-lg-6 -->
      </div><!-- /.row -->
    

Segmented buttons

<div class="input-group">
      <div class="input-group-btn">
      <!-- Button and dropdown menu -->
      </div>
      <input type="text" class="form-control">
      </div>

      <div class="input-group">
      <input type="text" class="form-control">
      <div class="input-group-btn">
      <!-- Button and dropdown menu -->
      </div>
      </div>
    

Navs available in Bootstrap have shared markup, starting with the base .nav class, as well as shared states. Swap modifier classes to switch between each style.

Note the .nav-tabs class requires the .nav base class.

<ul class="nav nav-tabs">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">Profile</a></li>
        <li><a href="#">Messages</a></li>
        </ul>
      

Requires JavaScript tabs plugin

For tabs with tabbable areas, you must use the tabs JavaScript plugin.

Take that same HTML, but use .nav-pills instead:

<ul class="nav nav-pills">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">Profile</a></li>
        <li><a href="#">Messages</a></li>
        </ul>
      

Pills are also vertically stackable. Just add .nav-stacked.

<ul class="nav nav-pills nav-stacked">
        ...
        </ul>
      

Easily make tabs or pills equal widths of their parent at screens wider than 768px with .nav-justified. On smaller screens, the nav links are stacked.

WebKit and responsive justified navs

Chrome and Safari both exhibit a bug in which resizing your browser horizontally causes rendering errors in the justified nav that are cleared upon refreshing. This bug is also shown in the justified nav example.

<ul class="nav nav-tabs nav-justified">
        ...
        </ul>
        <ul class="nav nav-pills nav-justified">
        ...
        </ul>
      

For any nav component (tabs, pills, or list), add .disabled for gray links and no hover effects.

Link functionality not impacted

This class will only change the <a>'s appearance, not its functionality. Use custom JavaScript to disable links here.

<ul class="nav nav-pills">
        ...
        <li class="disabled"><a href="#">Disabled link</a></li>
        ...
        </ul>
      

Add dropdown menus with a little extra HTML and the dropdowns JavaScript plugin.

Tabs with dropdowns

<ul class="nav nav-tabs">
        ...
        <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
        Dropdown <span class="caret"></span>
        </a>
        <ul class="dropdown-menu">
        ...
        </ul>
        </li>
        ...
        </ul>
      

Pills with dropdowns

<ul class="nav nav-pills">
        ...
        <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
        Dropdown <span class="caret"></span>
        </a>
        <ul class="dropdown-menu">
        ...
        </ul>
        </li>
        ...
        </ul>
      

Indicate the current page's location within a navigational hierarchy.

Separators are automatically added in CSS through :before and content.

<ol class="breadcrumb">
        <li><a href="#">Home</a></li>
        <li><a href="#">Library</a></li>
        <li class="active">Data</li>
        </ol>
      

Provide pagination links for your site or app with the multi-page pagination component, or the simpler pager alternative.

Default pagination

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.

<ul class="pagination">
        <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>
      

Disabled and active states

Links are customizable for different circumstances. Use .disabled for unclickable links and .active to indicate the current page.

<ul class="pagination">
        <li class="disabled"><a href="#">&laquo;</a></li>
        <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
        ...
        </ul>
      

You can optionally swap out active or disabled anchors for <span> to remove click functionality while retaining intended styles.

<ul class="pagination">
        <li class="disabled"><span>&laquo;</span></li>
        <li class="active"><span>1 <span class="sr-only">(current)</span></span></li>
        ...
        </ul>
      

Sizing

Fancy larger or smaller pagination? Add .pagination-lg or .pagination-sm for additional sizes.

<ul class="pagination pagination-lg">...</ul>
        <ul class="pagination">...</ul>
        <ul class="pagination pagination-sm">...</ul>
      

Pager

Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines.

Default example

By default, the pager centers links.

<ul class="pager">
        <li><a href="#">Previous</a></li>
        <li><a href="#">Next</a></li>
        </ul>
      

Aligned links

Alternatively, you can align each link to the sides:

<ul class="pager">
        <li class="previous"><a href="#">&larr; Older</a></li>
        <li class="next"><a href="#">Newer &rarr;</a></li>
        </ul>
      

Optional disabled state

Pager links also use the general .disabled utility class from the pagination.

<ul class="pager">
        <li class="previous disabled"><a href="#">&larr; Older</a></li>
        <li class="next"><a href="#">Newer &rarr;</a></li>
        </ul>
      

Example

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New
<h3>Example heading <span class="label label-default">New</span></h3>
      

Available variations

Add any of the below mentioned modifier classes to change the appearance of a label.

Default Primary Success Info Warning Danger
<span class="label label-default">Default</span>
        <span class="label label-primary">Primary</span>
        <span class="label label-success">Success</span>
        <span class="label label-info">Info</span>
        <span class="label label-warning">Warning</span>
        <span class="label label-danger">Danger</span>
      

Easily highlight new or unread items by adding a <span class="badge"> to links, Bootstrap navs, and more.

<a href="#">Inbox <span class="badge">42</span></a>
      

Self collapsing

When there are no new or unread items, badges will simply collapse (via CSS's :empty selector) provided no content exists within.

Cross-browser compatibility

Badges won't self collapse in Internet Explorer 8 because it lacks support for the :empty selector.

Adapts to active nav states

Built-in styles are included for placing badges in active states in pill and list navigations.

<ul class="nav nav-pills nav-stacked">
        <li class="active">
        <a href="#">
        <span class="badge pull-right">42</span>
        Home
        </a>
        </li>
        ...
        </ul>
      

A lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.

Hello, world!

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

<div class="jumbotron">
        <h1>Hello, world!</h1>
        <p>...</p>
        <p><a class="btn btn-primary btn-lg" role="button">Learn more</a></p>
        </div>
      

To make the jumbotron full width, and without rounded corners, place it outside all .containers and instead add a .container within.

<div class="jumbotron">
        <div class="container">
        ...
        </div>
        </div>
      

A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the h1's default small element, as well as most other components (with additional styles).

<div class="page-header">
        <h1>Example page header <small>Subtext for header</small></h1>
        </div>
      

Extend Bootstrap's grid system with the thumbnail component to easily display grids of images, videos, text, and more.

Default example

By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.

<div class="row">
        <div class="col-sm-6 col-md-3">
        <a href="#" class="thumbnail">
        <img data-src="holder.js/100%x180" alt="...">
        </a>
        </div>
        ...
        </div>
      

Custom content

With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.

300x200

Thumbnail label

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.

Button Button

300x200

Thumbnail label

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.

Button Button

300x200

Thumbnail label

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.

Button Button

<div class="row">
        <div class="col-sm-6 col-md-4">
        <div class="thumbnail">
        <img data-src="holder.js/300x200" alt="...">
        <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
        </div>
        </div>
        </div>
        </div>
      

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. For inline dismissal, use the alerts jQuery plugin.

Examples

Wrap any text and an optional dismiss button in .alert and one of the four contextual classes (e.g., .alert-success) for basic alert messages.

No default class

Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.

Well done! You successfully read this important alert message.
Heads up! This alert needs your attention, but it's not super important.
Warning! Best check yo self, you're not looking too good.
Oh snap! Change a few things up and try submitting again.
<div class="alert alert-success">...</div>
        <div class="alert alert-info">...</div>
        <div class="alert alert-warning">...</div>
        <div class="alert alert-danger">...</div>
      

Dismissable alerts

Build on any alert by adding an optional .alert-dismissable and close button.

Warning! Best check yo self, you're not looking too good.
<div class="alert alert-warning alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <strong>Warning!</strong> Best check yo self, you're not looking too good.
        </div>
      

Ensure proper behavior across all devices

Be sure to use the <button> element with the data-dismiss="alert" data attribute.

Use the .alert-link utility class to quickly provide matching colored links within any alert.

Well done! You successfully read this important alert message.
Heads up! This alert needs your attention, but it's not super important.
Warning! Best check yo self, you're not looking too good.
Oh snap! Change a few things up and try submitting again.
<div class="alert alert-success">
        <a href="#" class="alert-link">...</a>
        </div>
        <div class="alert alert-info">
        <a href="#" class="alert-link">...</a>
        </div>
        <div class="alert alert-warning">
        <a href="#" class="alert-link">...</a>
        </div>
        <div class="alert alert-danger">
        <a href="#" class="alert-link">...</a>
        </div>
      

Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars.

Cross-browser compatibility

Progress bars use CSS3 transitions and animations to achieve some of their effects. These features are not supported in Internet Explorer 9 and below or older versions of Firefox. Opera 12 does not support animations.

Basic example

Default progress bar.

60% Complete
<div class="progress">
        <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
        <span class="sr-only">60% Complete</span>
        </div>
        </div>
      

Contextual alternatives

Progress bars use some of the same button and alert classes for consistent styles.

40% Complete (success)
20% Complete
60% Complete (warning)
80% Complete (danger)
<div class="progress">
        <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
        <span class="sr-only">40% Complete (success)</span>
        </div>
        </div>
        <div class="progress">
        <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
        <span class="sr-only">20% Complete</span>
        </div>
        </div>
        <div class="progress">
        <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
        <span class="sr-only">60% Complete (warning)</span>
        </div>
        </div>
        <div class="progress">
        <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
        <span class="sr-only">80% Complete</span>
        </div>
        </div>
      

Striped

Uses a gradient to create a striped effect. Not available in IE8.

40% Complete (success)
20% Complete
60% Complete (warning)
80% Complete (danger)
<div class="progress progress-striped">
        <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
        <span class="sr-only">40% Complete (success)</span>
        </div>
        </div>
        <div class="progress progress-striped">
        <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
        <span class="sr-only">20% Complete</span>
        </div>
        </div>
        <div class="progress progress-striped">
        <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
        <span class="sr-only">60% Complete (warning)</span>
        </div>
        </div>
        <div class="progress progress-striped">
        <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
        <span class="sr-only">80% Complete (danger)</span>
        </div>
        </div>
      

Animated

Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.

45% Complete
<div class="progress progress-striped active">
        <div class="progress-bar"  role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
        <span class="sr-only">45% Complete</span>
        </div>
        </div>
      

Stacked

Place multiple bars into the same .progress to stack them.

35% Complete (success)
20% Complete (warning)
10% Complete (danger)
<div class="progress">
        <div class="progress-bar progress-bar-success" style="width: 35%">
        <span class="sr-only">35% Complete (success)</span>
        </div>
        <div class="progress-bar progress-bar-warning" style="width: 20%">
        <span class="sr-only">20% Complete (warning)</span>
        </div>
        <div class="progress-bar progress-bar-danger" style="width: 10%">
        <span class="sr-only">10% Complete (danger)</span>
        </div>
        </div>
      

Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.

Default media

The default media allow to float a media object (images, video, audio) to the left or right of a content block.

64x64

Media heading

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
64x64

Media heading

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
64x64

Media heading

Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
<div class="media">
        <a class="pull-left" href="#">
        <img class="media-object" src="..." alt="...">
        </a>
        <div class="media-body">
        <h4 class="media-heading">Media heading</h4>
        ...
        </div>
        </div>
      

Media list

With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).

  • 64x64

    Media heading

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

    64x64

    Nested media heading

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
    64x64

    Nested media heading

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
    64x64

    Nested media heading

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
  • 64x64

    Media heading

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
<ul class="media-list">
        <li class="media">
        <a class="pull-left" href="#">
        <img class="media-object" src="..." alt="...">
        </a>
        <div class="media-body">
        <h4 class="media-heading">Media heading</h4>
        ...
        </div>
        </li>
        </ul>
      

List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.

Basic example

The most basic list group is simply an unordered list with list items, and the proper classes. Build upon it with the options that follow, or your own CSS as needed.

  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus
  • Porta ac consectetur ac
  • Vestibulum at eros
<ul class="list-group">
        <li class="list-group-item">Cras justo odio</li>
        <li class="list-group-item">Dapibus ac facilisis in</li>
        <li class="list-group-item">Morbi leo risus</li>
        <li class="list-group-item">Porta ac consectetur ac</li>
        <li class="list-group-item">Vestibulum at eros</li>
        </ul>
      

Badges

Add the badges component to any list group item and it will automatically be positioned on the right.

  • 14 Cras justo odio
  • 2 Dapibus ac facilisis in
  • 1 Morbi leo risus
<ul class="list-group">
        <li class="list-group-item">
        <span class="badge">14</span>
        Cras justo odio
        </li>
        </ul>
      

Linked items

Linkify list group items by using anchor tags instead of list items (that also means a parent <div> instead of an <ul>). No need for individual parents around each element.

<div class="list-group">
        <a href="#" class="list-group-item active">
        Cras justo odio
        </a>
        <a href="#" class="list-group-item">Dapibus ac facilisis in</a>
        <a href="#" class="list-group-item">Morbi leo risus</a>
        <a href="#" class="list-group-item">Porta ac consectetur ac</a>
        <a href="#" class="list-group-item">Vestibulum at eros</a>
        </div>
      

Custom content

Add nearly any HTML within, even for linked list groups like the one below.

<div class="list-group">
        <a href="#" class="list-group-item active">
        <h4 class="list-group-item-heading">List group item heading</h4>
        <p class="list-group-item-text">...</p>
        </a>
        </div>
      

While not always necessary, sometimes you need to put your DOM in a box. For those situations, try the panel component.

Basic example

By default, all the .panel does is apply some basic border and padding to contain some content.

Basic panel example
<div class="panel panel-default">
      <div class="panel-body">
      Basic panel example
      </div>
      </div>
    

Panel with heading

Easily add a heading container to your panel with .panel-heading. You may also include any <h1>-<h6> with a .panel-title class to add a pre-styled heading.

Panel heading without title
Panel content

Panel title

Panel content
<div class="panel panel-default">
      <div class="panel-heading">Panel heading without title</div>
      <div class="panel-body">
      Panel content
      </div>
      </div>

      <div class="panel panel-default">
      <div class="panel-heading">
      <h3 class="panel-title">Panel title</h3>
      </div>
      <div class="panel-body">
      Panel content
      </div>
      </div>
    

Wrap buttons or secondary text in .panel-footer. Note that panel footers do not inherit colors and borders when using contextual variations as they are not meant to be in the foreground.

Panel content
<div class="panel panel-default">
      <div class="panel-body">
      Panel content
      </div>
      <div class="panel-footer">Panel footer</div>
      </div>
    

Contextual alternatives

Like other components, easily make a panel more meaningful to a particular context by adding any of the contextual state classes.

Panel title

Panel content

Panel title

Panel content

Panel title

Panel content

Panel title

Panel content

Panel title

Panel content
<div class="panel panel-primary">...</div>
      <div class="panel panel-success">...</div>
      <div class="panel panel-info">...</div>
      <div class="panel panel-warning">...</div>
      <div class="panel panel-danger">...</div>
    

With tables

Add any non-bordered .table within a panel for a seamless design. If there is a .panel-body, we add an extra border to the top of the table for separation.

Panel heading

Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
<div class="panel panel-default">
      <!-- Default panel contents -->
      <div class="panel-heading">Panel heading</div>
      <div class="panel-body">
      <p>...</p>
      </div>

      <!-- Table -->
      <table class="table">
      ...
      </table>
      </div>
    

If there is no panel body, the component moves from panel header to table without interruption.

Panel heading
# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
<div class="panel panel-default">
      <!-- Default panel contents -->
      <div class="panel-heading">Panel heading</div>

      <!-- Table -->
      <table class="table">
      ...
      </table>
      </div>
    

With list groups

Easily include full-width list groups within any panel.

Panel heading

Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.

  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus
  • Porta ac consectetur ac
  • Vestibulum at eros
<div class="panel panel-default">
      <!-- Default panel contents -->
      <div class="panel-heading">Panel heading</div>
      <div class="panel-body">
      <p>...</p>
      </div>

      <!-- List group -->
      <ul class="list-group">
      <li class="list-group-item">Cras justo odio</li>
      <li class="list-group-item">Dapibus ac facilisis in</li>
      <li class="list-group-item">Morbi leo risus</li>
      <li class="list-group-item">Porta ac consectetur ac</li>
      <li class="list-group-item">Vestibulum at eros</li>
      </ul>
      </div>
    

Default well

Use the well as a simple effect on an element to give it an inset effect.

Look, I'm in a well!
<div class="well">...</div>
      

Optional classes

Control padding and rounded corners with two optional modifier classes.

Look, I'm in a large well!
<div class="well well-lg">...</div>
      
Look, I'm in a small well!
<div class="well well-sm">...</div>