Colour Scheme
secondary primary info success warning danger
text-secondary text-primary text-info text-success text-warning text-danger
Typography (h1)
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)
Lorem Ipsum Dolor Sit Amet (h2)
Lorem ipsum dolor sit amet, consectetuer adipiscing elit (strong), sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)
Lorem Ipsum Dolor Sit Amet (h3)
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)
Lorem Ipsum Dolor Sit Amet (h4)
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)
Lorem Ipsum Dolor Sit Amet (h5)
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)
Lists
(ol)(li)
- Lorem ipsum dolor sit amet consectetur
- Lorem ipsum dolor sit amet consectetur
(ul)(li)
- Lorem ipsum dolor sit amet consectetur
- Lorem ipsum dolor sit amet consectetur
Displays
Lorem (display-1)
Lorem (display-2)
Lorem ipsum (display-3)
Lorem ipsum (display-4)
Lorem ipsum arma virumque cano (lead)
Dropdown menus
Example
Toggleable, contextual menu for displaying lists of links. Made interactive with the dropdown JavaScript plugin.
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <li><a tabindex="-1" href="#">Action</a></li> <li><a tabindex="-1" href="#">Another action</a></li> <li><a tabindex="-1" href="#">Something else here</a></li> <li class="divider"></li> <li><a tabindex="-1" href="#">Separated link</a></li> </ul>
Markup
Looking at just the dropdown menu, here's the required HTML. You need to wrap the dropdown's trigger and the dropdown menu within .dropdown
, or another element that declares position: relative;
. Then just create the menu.
<div class="dropdown"> <!-- Link or button to toggle dropdown --> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <li><a tabindex="-1" href="#">Action</a></li> <li><a tabindex="-1" href="#">Another action</a></li> <li><a tabindex="-1" href="#">Something else here</a></li> <li class="divider"></li> <li><a tabindex="-1" href="#">Separated link</a></li> </ul> </div>
Options
Align menus to the right and add include additional levels of dropdowns.
Aligning the menus
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>
Disabled menu options
Add .disabled
to a <li>
in the dropdown to disable the link.
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <li><a tabindex="-1" href="#">Regular link</a></li> <li class="disabled"><a tabindex="-1" href="#">Disabled link</a></li> <li><a tabindex="-1" href="#">Another link</a></li> </ul>
Sub menus on dropdowns
Add an extra level of dropdown menus, appearing on hover like those of OS X, with some simple markup additions. Add .dropdown-submenu
to any li
in an existing dropdown menu for automatic styling.
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> ... <li class="dropdown-submenu"> <a tabindex="-1" href="#">More options</a> <ul class="dropdown-menu"> ... </ul> </li> </ul>
Pagination Two options for paging through content
Standard 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.
<div class="pagination"> <ul> <li><a href="#">Prev</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="#">Next</a></li> </ul> </div>
Options
Disabled and active states
Links are customizable for different circumstances. Use .disabled
for unclickable links and .active
to indicate the current page.
<div class="pagination"> <ul> <li class="disabled"><a href="#">«</a></li> <li class="active"><a href="#">1</a></li> ... </ul> </div>
You can optionally swap out active or disabled anchors for col-md-s to remove click functionality while retaining intended styles.
<div class="pagination"> <ul> <li class="disabled"><col-md->«</col-md-></li> <li class="active"><col-md->1</col-md-></li> ... </ul> </div>
Sizes
Fancy larger or smaller pagination? Add .pagination-large
, .pagination-small
, or .pagination-mini
for additional sizes.
<div class="pagination pagination-large"> <ul> ... </ul> </div> <div class="pagination"> <ul> ... </ul> </div> <div class="pagination pagination-small"> <ul> ... </ul> </div> <div class="pagination pagination-mini"> <ul> ... </ul> </div>
Alignment
Add one of two optional classes to change the alignment of pagination links: .pagination-centered
and .pagination-right
.
<div class="pagination pagination-centered"> ... </div>
<div class="pagination pagination-right"> ... </div>
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="#">← Older</a> </li> <li class="next"> <a href="#">Newer →</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="#">← Older</a> </li> ... </ul>
Labels and badges
Labels
Labels | Markup |
---|---|
Default | <col-md- class="label">Default</col-md-> |
Success | <col-md- class="label label-success">Success</col-md-> |
Warning | <col-md- class="label label-warning">Warning</col-md-> |
Important | <col-md- class="label label-important">Important</col-md-> |
Info | <col-md- class="label label-info">Info</col-md-> |
Inverse | <col-md- class="label label-inverse">Inverse</col-md-> |
Badges
Name | Example | Markup |
---|---|---|
Default | 1 | <col-md- class="badge">1</col-md-> |
Success | 2 | <col-md- class="badge badge-success">2</col-md-> |
Warning | 4 | <col-md- class="badge badge-warning">4</col-md-> |
Important | 6 | <col-md- class="badge badge-important">6</col-md-> |
Info | 8 | <col-md- class="badge badge-info">8</col-md-> |
Inverse | 10 | <col-md- class="badge badge-inverse">10</col-md-> |
Easily collapsible
For easy implementation, labels and badges will simply collapse (via CSS's :empty
selector) when no content exists within.
Typographic components
Hero unit
A lightweight, flexible component to showcase key content on your site. It works well on marketing and content-heavy sites.
Hello, world!
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
<div class="hero-unit"> <h1>Heading</h1> <p>Tagline</p> <p> <a class="btn btn-primary btn-large"> Learn more </a> </p> </div>
Page header
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 most other components (with additional styles).
Example page header Subtext for header
<div class="page-header"> <h1>Example page header <small>Subtext for header</small></h1> </div>
Thumbnails Grids of images, videos, text, and more
Default thumbnails
By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.
Highly customizable
With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.
Why use thumbnails
Thumbnails (previously .media-grid
up until v1.4) are great for grids of photos or videos, image search results, retail products, portfolios, and much more. They can be links or static content.
Simple, flexible markup
Thumbnail markup is simple—a ul
with any number of li
elements is all that is required. It's also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.
Uses grid column sizes
Lastly, the thumbnails component uses existing grid system classes—like .col-md-2
or .col-md-3
—for control of thumbnail dimensions.
Markup
As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup for linked images:
<ul class="thumbnails"> <li class="col-md-4"> <a href="#" class="thumbnail"> <img data-src="holder.js/300x200" alt=""> </a> </li> ... </ul>
For custom HTML content in thumbnails, the markup changes slightly. To allow block level content anywhere, we swap the <a>
for a <div>
like so:
<ul class="thumbnails"> <li class="col-md-4"> <div class="thumbnail"> <img data-src="holder.js/300x200" alt=""> <h3>Thumbnail label</h3> <p>Thumbnail caption...</p> </div> </li> ... </ul>
More examples
Explore all your options with the various grid classes available to you. You can also mix and match different sizes.
Alerts Styles for success, warning, and error messages
Default alert
Wrap any text and an optional dismiss button in .alert
for a basic warning alert message.
<div class="alert"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Warning!</strong> Best check yo self, you're not looking too good. </div>
Dismiss buttons
Mobile Safari and Mobile Opera browsers, in addition to the data-dismiss="alert"
attribute, require an href="#"
for the dismissal of alerts when using an <a>
tag.
<a href="#" class="close" data-dismiss="alert">×</a>
Alternatively, you may use a <button>
element with the data attribute, which we have opted to do for our docs. When using <button>
, you must include type="button"
or your forms may not submit.
<button type="button" class="close" data-dismiss="alert">×</button>
Dismiss alerts via JavaScript
Use the alerts jQuery plugin for quick and easy dismissal of alerts.
Options
For longer messages, increase the padding on the top and bottom of the alert wrapper by adding .alert-block
.
Warning!
Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<div class="alert alert-block"> <button type="button" class="close" data-dismiss="alert">×</button> <h4>Warning!</h4> Best check yo self, you're not... </div>
Contextual alternatives
Add optional classes to change an alert's connotation.
Error or danger
<div class="alert alert-error"> ... </div>
Success
<div class="alert alert-success"> ... </div>
Information
<div class="alert alert-info"> ... </div>
Progress bars For loading, redirecting, or action status
Examples and markup
Basic
Default progress bar with a vertical gradient.
<div class="progress"> <div class="bar" style="width: 60%;"></div> </div>
Striped
Uses a gradient to create a striped effect. Not available in IE7-8.
<div class="progress progress-striped"> <div class="bar" style="width: 20%;"></div> </div>
Animated
Add .active
to .progress-striped
to animate the stripes right to left. Not available in all versions of IE.
<div class="progress progress-striped active"> <div class="bar" style="width: 40%;"></div> </div>
Stacked
Place multiple bars into the same .progress
to stack them.
<div class="progress"> <div class="bar bar-success" style="width: 35%;"></div> <div class="bar bar-warning" style="width: 20%;"></div> <div class="bar bar-danger" style="width: 10%;"></div> </div>
Options
Additional colors
Progress bars use some of the same button and alert classes for consistent styles.
<div class="progress progress-info"> <div class="bar" style="width: 20%"></div> </div> <div class="progress progress-success"> <div class="bar" style="width: 40%"></div> </div> <div class="progress progress-warning"> <div class="bar" style="width: 60%"></div> </div> <div class="progress progress-danger"> <div class="bar" style="width: 80%"></div> </div>
Striped bars
Similar to the solid colors, we have varied striped progress bars.
<div class="progress progress-info progress-striped"> <div class="bar" style="width: 20%"></div> </div> <div class="progress progress-success progress-striped"> <div class="bar" style="width: 40%"></div> </div> <div class="progress progress-warning progress-striped"> <div class="bar" style="width: 60%"></div> </div> <div class="progress progress-danger progress-striped"> <div class="bar" style="width: 80%"></div> </div>
Browser support
Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in IE7-9 or older versions of Firefox.
Versions earlier than Internet Explorer 10 and Opera 12 do not support animations.
Media object
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 example
The default media allow to float a media object (images, video, audio) to the left or right of a content block.
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" data-src="holder.js/64x64"> </a> <div class="media-body"> <h4 class="media-heading">Media heading</h4> ... <!-- Nested media object --> <div class="media"> ... </div> </div> </div>
Media list
With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).
-
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.
-
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" data-src="holder.js/64x64"> </a> <div class="media-body"> <h4 class="media-heading">Media heading</h4> ... <!-- Nested media object --> <div class="media"> ... </div> </div> </li> </ul>
Miscellaneous Lightweight utility components
Wells
Use the well as a simple effect on an element to give it an inset effect.
<div class="well"> ... </div>
Optional classes
Control padding and rounded corners with two optional modifier classes.
<div class="well well-large"> ... </div>
<div class="well well-small"> ... </div>
Close icon
Use the generic close icon for dismissing content like modals and alerts.
<button class="close">×</button>
iOS devices require an href="#"
for click events if you would rather use an anchor.
<a class="close" href="#">×</a>
Helper classes
Simple, focused classes for small display or behavior tweaks.
.pull-left
Float an element left
class="pull-left"
.pull-left { float: left; }
.pull-right
Float an element right
class="pull-right"
.pull-right { float: right; }
.muted
Change an element's color to #999
class="muted"
.muted { color: #999; }
.clearfix
Clear the float
on any element
class="clearfix"
.clearfix { *zoom: 1; &:before, &:after { display: table; content: ""; } &:after { clear: both; } }
Global settings
Requires HTML5 doctype
Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.
<!DOCTYPE html> <html lang="en"> ... </html>
Typography and links
Bootstrap sets basic global display, typography, and link styles. Specifically, we:
- Remove
margin
on the body - Set
background-color: white;
on thebody
- Use the
@baseFontFamily
,@baseFontSize
, and@baseLineHeight
attributes as our typographic base - Set the global link color via
@linkColor
and apply link underlines only on:hover
These styles can be found within scaffolding.less.
Reset via Normalize
With Bootstrap 2, the old reset block has been dropped in favor of Normalize.css, a project by Nicolas Gallagher and Jonathan Neal that also powers the HTML5 Boilerplate. While we use much of Normalize within our reset.less, we have removed some elements specifically for Bootstrap.
Default grid system
Live grid example
The default Bootstrap grid system utilizes 12 columns, making for a 940px wide container without responsive features enabled. With the responsive CSS file added, the grid adapts to be 724px and 1170px wide depending on your viewport. Below 767px viewports, the columns become fluid and stack vertically.
Basic grid HTML
For a simple two column layout, create a .row
and add the appropriate number of .col-md-*
columns. As this is a 12-column grid, each .col-md-*
col-md-s a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent).
<div class="row"> <div class="col-md-4">...</div> <div class="col-md-8">...</div> </div>
Given this example, we have .col-md-4
and .col-md-8
, making for 12 total columns and a complete row.
Offsetting columns
Move columns to the right using .offset*
classes. Each class increases the left margin of a column by a whole column. For example, .offset4
moves .col-md-4
over four columns.
<div class="row"> <div class="col-md-4">...</div> <div class="col-md-3 offset2">...</div> </div>
Nesting columns
To nest your content with the default grid, add a new .row
and set of .col-md-*
columns within an existing .col-md-*
column. Nested rows should include a set of columns that add up to the number of columns of its parent.
<div class="row"> <div class="col-md-9"> Level 1 column <div class="row"> <div class="col-md-6">Level 2</div> <div class="col-md-3">Level 2</div> </div> </div> </div>
Fluid grid system
Live fluid grid example
The fluid grid system uses percents instead of pixels for column widths. It has the same responsive capabilities as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.
Basic fluid grid HTML
Make any row "fluid" by changing .row
to .row-fluid
. The column classes stay the exact same, making it easy to flip between fixed and fluid grids.
<div class="row-fluid"> <div class="col-md-4">...</div> <div class="col-md-8">...</div> </div>
Fluid offsetting
Operates the same way as the fixed grid system offsetting: add .offset*
to any column to offset by that many columns.
<div class="row-fluid"> <div class="col-md-4">...</div> <div class="col-md-4 offset2">...</div> </div>
Fluid nesting
Fluid grids utilize nesting differently: each nested level of columns should add up to 12 columns. This is because the fluid grid uses percentages, not pixels, for setting widths.
<div class="row-fluid"> <div class="col-md-12"> Fluid 12 <div class="row-fluid"> <div class="col-md-6"> Fluid 6 <div class="row-fluid"> <div class="col-md-6">Fluid 6</div> <div class="col-md-6">Fluid 6</div> </div> </div> <div class="col-md-6">Fluid 6</div> </div> </div> </div>
Layouts
Fixed layout
Provides a common fixed-width (and optionally responsive) layout with only <div class="container">
required.
<body> <div class="container"> ... </div> </body>
Fluid layout
Create a fluid, two-column page with <div class="container-fluid">
—great for applications and docs.
<div class="container-fluid"> <div class="row-fluid"> <div class="col-md-2"> <!--Sidebar content--> </div> <div class="col-md-10"> <!--Body content--> </div> </div> </div>
Responsive design
Enabling responsive features
Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the <head>
of your document. If you've compiled Bootstrap from the Customize page, you need only include the meta tag.
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet">
Heads up! Bootstrap doesn't include responsive features by default at this time as not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it as needed.
About responsive Bootstrap

Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width
and max-width
.
- Modify the width of column in our grid
- Stack elements instead of float wherever necessary
- Resize headings and text to be more appropriate for devices
Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.
Supported devices
Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:
Label | Layout width | Column width | Gutter width |
---|---|---|---|
Large display | 1200px and up | 70px | 30px |
Default | 980px and up | 60px | 20px |
Portrait tablets | 768px and above | 42px | 20px |
Phones to tablets | 767px and below | Fluid columns, no fixed widths | |
Phones | 480px and below | Fluid columns, no fixed widths |
/* Large desktop */ @media (min-width: 1200px) { ... } /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { ... } /* Landscape phone to portrait tablet */ @media (max-width: 767px) { ... } /* Landscape phones and down */ @media (max-width: 480px) { ... }
Responsive utility classes
For faster mobile-friendly development, use these utility classes for showing and hiding content by device. Below is a table of the available classes and their effect on a given media query layout (labeled by device). They can be found in responsive.less
.
Class | Phones 767px and below | Tablets 979px to 768px | Desktops Default |
---|---|---|---|
.visible-phone |
Visible | Hidden | Hidden |
.visible-tablet |
Hidden | Visible | Hidden |
.visible-desktop |
Hidden | Hidden | Visible |
.hidden-phone |
Hidden | Visible | Visible |
.hidden-tablet |
Visible | Hidden | Visible |
.hidden-desktop |
Visible | Visible | Hidden |
When to use
Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation. Responsive utilities should not be used with tables, and as such are not supported.
Responsive utilities test case
Resize your browser or load on different devices to test the above classes.
Visible on...
Green checkmarks indicate that class is visible in your current viewport.
- Phone✔ Phone
- Tablet✔ Tablet
- Desktop✔ Desktop
Hidden on...
Here, green checkmarks indicate that class is hidden in your current viewport.