diff --git a/_config.yml b/_config.yml index 57a28e0a78..266b8b5bf0 100644 --- a/_config.yml +++ b/_config.yml @@ -9,4 +9,4 @@ permalink: pretty source: ./docs destination: ./_gh_pages url: http://bootstrap.dev:9001 -server_port: 9001 +server_port: 9001 \ No newline at end of file diff --git a/docs/_includes/header.html b/docs/_includes/header.html index f738b91467..af2104ebb8 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -14,7 +14,7 @@ -{% if page.layout == "default" %} +{% if page.layout != "example" %} diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index acab46de92..11b78f3f92 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -5,10 +5,7 @@ {% include header.html %} - - - - {% include navbar.html %} + {{ content }} diff --git a/docs/_layouts/home.html b/docs/_layouts/home.html new file mode 100644 index 0000000000..e837f95173 --- /dev/null +++ b/docs/_layouts/home.html @@ -0,0 +1,20 @@ + + + + + {% include header.html %} + + + + + + {{ content }} + + + {% include colophon.html %} + + + {% include footer.html %} + + + diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index 926ae3913e..9bab1a0ea0 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -9,16 +9,18 @@ -------------------------------------------------- */ body { - padding-top: 54px; position: relative; /* For scrollyspy */ /* We add the padding to the body for >768px only */ } -.bs-docs-container { - max-width: 860px; +.bs-docs-container, +.bs-home-container { padding-left: 15px; padding-right: 15px; } +.bs-docs-container { + max-width: 860px; +} /* */ .bs-docs-footer { @@ -47,36 +49,6 @@ section > ul li { -/* Navbar --------------------------------------------------- */ - -.bs-docs-navbar { - background-color: #333; -} -.bs-docs-navbar .navbar-brand { - padding: 15px; - font-size: 30px; - margin-left: 0; -} -.bs-docs-navbar .nav { - border-top: 1px solid #222; - border-bottom: 1px solid #444; -} -.bs-docs-navbar .nav > li > a { - width: 60px; - text-align: center; - border-top: 1px solid #444; - border-bottom: 1px solid #222; -} -.bs-docs-navbar .glyphicon { - display: block; - font-size: 20px; -} -.bs-docs-navbar .nav .tooltip { - white-space: nowrap; -} - - /* Jumbotrons -------------------------------------------------- */ @@ -195,23 +167,33 @@ section > ul li { -------------------------------------------------- */ .bs-docs-sidebar { + display: none; position: fixed; top: 0; - left: 60px; + left: 0; bottom: 0; width: 240px; background-color: #f5f5f5; - border-right: 1px solid #e5e5e5; + overflow-y: scroll; + text-shadow: 0 1px 0 #fff; + box-shadow: inset -1px 0 0 #e5e5e5; +} +.bs-docs-sidenav { + margin: 0 0 25px; } .bs-docs-sidenav > li > a { - color: #555; - padding: 8px 20px; + color: #666; + padding: 4px 20px; +} +.bs-docs-sidenav > li > a:hover { + border-right: 1px solid #d5d5d5; } .bs-docs-sidenav > .active > a, .bs-docs-sidenav > .active:hover > a, .bs-docs-sidenav > .active:focus > a { - color: #fff; - background-color: #428bca; + font-weight: 500; + color: #428bca; + border-right: 1px solid #428bca; } .bs-docs-sidenav-heading { @@ -222,56 +204,17 @@ section > ul li { box-shadow: 0 1px 0 #fff; } -.bs-docs-navbar:after, -.bs-docs-sidebar:after { - position: absolute; - top: -20px; - right: 0; - bottom: -20px; - left: -10px; - z-index: 10; - display: block; - content: " "; - box-shadow: inset -5px 0 25px rgba(0,0,0,.05); +.bs-docs-sidenav .nav-header { + padding: 25px 20px 5px; + font-size: 14px; + font-weight: 500; + color: #333; } -.bs-docs-navbar .container, -.bs-docs-sidenav { - position: relative; - z-index: 15; +.bs-docs-sidenav > li + .nav-header { + margin-top: 0; } -/* Base styles are not affixable given mobile-first */ -.bs-docs-sidenav { - margin: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -/*.bs-docs-sidenav.affix { - position: static; - top: 0; -}*/ - -/* Chevrons within each link */ -/*.bs-docs-sidenav .glyphicon-chevron-right { - float: right; - margin-top: 1px; - margin-right: -6px; - opacity: .25; - color: #000; -} -.bs-docs-sidenav a:hover .glyphicon-chevron-right { - opacity: .5; -} -.bs-docs-sidenav .active .glyphicon-chevron-right, -.bs-docs-sidenav .active a:hover .glyphicon-chevron-right { - color: #fff; - opacity: 1; -} -*/ - - /* Bootstrap code examples -------------------------------------------------- */ @@ -674,18 +617,23 @@ input.focused { @media screen and (min-width: 768px) { /* Account for fixed navbar (which is static to start) */ - body { - /*padding-top: 50px;*/ /* Default height of navbar */ - padding-top: 0; - padding-left: 300px; + .bs-docs-docs { + padding-left: 260px; + padding-right: 20px; } /* Undo custom padding */ - .bs-docs-container { + .bs-docs-container, + .bs-home-container { padding-left: 0; padding-right: 0; } + /* Show the docs nav */ + .bs-docs-sidebar { + display: block; + } + /* Tweak display of docs jumbotrons */ .masthead { padding-top: 100px; @@ -705,19 +653,6 @@ input.focused { text-align: left; } - /* From here, start to affix the nav because we keep columns here */ - .bs-docs-sidenav.affix { - position: fixed; - top: 20px; - } - .bs-docs-sidenav { - width: 170px; - } - .bs-docs-sidenav.affix-bottom { - position: absolute; - top: auto; - bottom: 270px; - } } /* Tablets/desktops and up */ @@ -728,14 +663,9 @@ input.focused { width: 12.5%; } - .bs-docs-sidenav { - width: 240px; - } } /* Large desktops and up */ @media screen and (min-width: 1200px) { -/* .bs-docs-sidenav { - width: 240px; - } -*/} + +} diff --git a/docs/components.html b/docs/components.html deleted file mode 100644 index b42fad00bf..0000000000 --- a/docs/components.html +++ /dev/null @@ -1,1961 +0,0 @@ ---- -layout: default -title: Components ---- - - -
-
Components
- -
- - - -
- - - - - - - - -
- -

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.

- -

Single button group

-

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

-
-
- - - -
-
-{% highlight html linenos %} -
- - - -
-{% endhighlight %} - -

Multiple button groups

-

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

-
-
-
- - - - -
-
- - - -
-
- -
-
-
-{% highlight html linenos %} -
-
...
-
...
-
...
-
-{% endhighlight %} - -

Vertical button groups

-

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

-
-
- - - - -
-
-{% highlight html linenos %} -
- ... -
-{% endhighlight %} - -

Justified button groups

-

Make a group of buttons stretch at the same size to span the entire width of its parent. This only works with <a> elements as the <button> doesn't pick up these styles.

-
-
- Left - Right - Middle -
-
-{% highlight html linenos %} -
- ... -
-{% endhighlight %} - -
- - - - -
- -

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

- -

Single or split button

-

Turn a button into dropdown toggle, or add a second button to toggle the dropdown while retaining the primary button action.

- -{% highlight html linenos %} - - - - - -{% endhighlight %} - -

Works with all button sizes

-

Button dropdowns work at any size: .btn-large, .btn-small, or .btn-mini.

-
-
-
- - -
-
- - -
-
- - -
-
-
-{% highlight html linenos %} - -
- - -
- - -
- - -
- - -
- - -
-{% endhighlight %} - -

Dropup buttons

-

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

-
-
- -
- - - -
-
-
-{% highlight html linenos %} -
- - - -
-{% endhighlight %} - -
- - - - - - - - - - - - - - - - - - - -
- -

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

- -

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.

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -

Disabled and active states

-

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

-
- -
-{% highlight html linenos %} - -{% endhighlight %} -

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

-{% highlight html linenos %} - -{% endhighlight %} - - -

Sizes

-

Fancy larger or smaller pagination? Add .pagination-large, .pagination-small, or .pagination-mini for additional sizes.

-
-
- -
-
- -
-
- -
-
- -
-
-{% highlight html linenos %} - - - - -{% endhighlight %} - - -

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.

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -

Aligned links

-

Alternatively, you can align each link to the sides:

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - - -

Optional disabled state

-

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

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - - -
- - - - -
- -

- -

Example

-
-

Example heading New

-

Example heading New

-

Example heading New

-

Example heading New

-
Example heading New
-
Example heading New
-
-{% highlight html linenos %} -

Example heading New

-{% endhighlight %} - -

Available variations

-

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

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

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

- -
- Inbox 42 -
-{% highlight html linenos %} -Inbox 42 -{% endhighlight %} - -

Self collapsing

-

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

- -

Adapts to active nav states

-

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

- -{% highlight html linenos %} - -{% endhighlight %} - -
- - - - -
- - -

Jumbotron

-

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.

-

Learn more

-
-
-{% highlight html linenos %} -
-

Hello, world!

-

...

-

Learn more

-
-{% endhighlight %} - -

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

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -
- - - - -
- -

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

- -

Default thumbnails

-

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

-
-
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
-
-{% highlight html linenos %} -
-
- - - -
- ... -
-{% endhighlight %} - -

Custom content thumbnails

-

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

-
-
-
-
- -
-

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.

-

Action Action

-
-
-
-
-
- -
-

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.

-

Action Action

-
-
-
-
-
- -
-

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.

-

Action Action

-
-
-
-
-
-{% highlight html linenos %} -
-
-
- -
-

Thumbnail label

-

...

-

Action Action

-
-
-
-
-{% endhighlight %} - - -
- - - - - -
- -

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.

- -

Default alert

-

Wrap any text and an optional dismiss button in .alert for a basic warning alert message. To ensure proper behavior across all devices, be sure to use <button> element with the data-dismiss="alert" data attribute.

-
-
- - Warning! Best check yo self, you're not looking too good. -
-
-{% highlight html linenos %} -
- - Warning! Best check yo self, you're not looking too good. -
-{% endhighlight %} - -

Block alerts

-

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.

-
-
-{% highlight html linenos %} -
- -

Warning!

-

...

-
-{% endhighlight %} - -

Contextual alternatives

-

Add optional classes to change an alert's connotation.

-
-
- - Oh snap! Change a few things up and try submitting again. -
-
- - Well done! You successfully read this important alert message. -
-
- - Heads up! This alert needs your attention, but it's not super important. -
-
-{% highlight html linenos %} -
...
-
...
-
...
-{% endhighlight %} -
- - - - - -
- -

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

- -

Progress bars use CSS3 transitions and animations to achieve some of their effects. These features are not supported in IE8-9 or older versions of Firefox. Internet Explorer 10 and below, as well as Opera 12, do not support animations.

- -

Basic

-

Default progress bar with a vertical gradient.

-
-
-
-
-
-{% highlight html linenos %} -
-
-
-{% endhighlight %} - -

Additional colors

-

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

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{% highlight html linenos %} -
-
-
-
-
-
-
-
-
-
-
-
-{% endhighlight %} - -

Striped

-

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

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{% highlight html linenos %} -
-
-
-
-
-
-
-
-
-
-
-
-{% endhighlight %} - -

Animated

-

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

-
-
-
-
-
-{% highlight html linenos %} -
-
-
-{% endhighlight %} - -

Stacked

-

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

-
-
-
-
-
-
-
-{% highlight html linenos %} -
-
-
-
-
-{% endhighlight %} - -
- - - - - -
- -

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

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

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. -
-
-
-
-
-{% highlight html linenos %} -
- - - -
-

Media heading

- ... -
-
-{% endhighlight %} - -

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.

    - -
    - - - -
    -

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

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

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

    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. -
    -
  • -
-
-{% highlight html linenos %} - -{% endhighlight %} - -
- - - - - - -
- - -

Wells

-

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

-
-
- Look, I'm in a well! -
-
-{% highlight html linenos %} -
...
-{% endhighlight %} -

Optional classes

-

Control padding and rounded corners with two optional modifier classes.

-
-
- Look, I'm in a well! -
-
-{% highlight html linenos %} -
...
-{% endhighlight %} - -
-
- Look, I'm in a well! -
-
-{% highlight html linenos %} -
...
-{% endhighlight %} - - -

Close icon

-

Use the generic close icon for dismissing content like modals and alerts.

-
-

-
-{% highlight html linenos %} - -{% endhighlight %} - -

Helper classes

-

Simple, focused classes for small display or behavior tweaks.

- -

.pull-left

-

Float an element left

-{% highlight html linenos %} -
...
-{% endhighlight %} -{% highlight css linenos %} -.pull-left { - float: left; -} -{% endhighlight %} - -

.pull-right

-

Float an element right

-{% highlight html linenos %} -
...
-{% endhighlight %} -{% highlight css linenos %} -.pull-right { - float: right; -} -{% endhighlight %} - -

.muted

-

Change an element's color to #999

-{% highlight html linenos %} -

...

-{% endhighlight %} -{% highlight css linenos %} -.muted { - color: #999; -} -{% endhighlight %} - - -

.clearfix

-

Clear the float on any element. Utilizes the micro clearfix as popularized by Nicolas Gallagher.

-{% highlight html linenos %} -
...
-{% endhighlight %} -{% highlight css linenos %} -.clearfix { - &:before, - &:after { - content: " "; - display: table; - } - &:after { - clear: both; - } -} -{% endhighlight %} - - -
- - - -
diff --git a/docs/css.html b/docs/css.html deleted file mode 100644 index 1c317d2cd7..0000000000 --- a/docs/css.html +++ /dev/null @@ -1,2409 +0,0 @@ ---- -layout: default -title: CSS ---- - -
-
CSS
- -
- - -
- - -
- -

Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.

- -

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.

- -{% highlight html linenos %} - - - ... - -{% endhighlight %} - -

Mobile first

-

With Bootstrap 2, we added optional mobile friendly styles for key aspects of the framework. With Bootstrap 3, we've rewritten the project to be mobile friendly from the start. Instead of adding on optional mobile styles, they're baked right into the core. In fact, Bootstrap is mobile first. Mobile first styles can be found throughout the entire library instead of in separate files.

-

To ensure proper rendering and touch zooming, add the viewport meta tag to your <head>.

- -{% highlight html linenos %} - -{% endhighlight %} - -

Typography and links

-

Bootstrap sets basic global display, typography, and link styles. Specifically, we:

- -

These styles can be found within scaffolding.less.

- -

Normalize reset

-

For improved cross-browser rendering, we use Normalize, a project by Nicolas Gallagher and Jonathan Neal.

- -
- - - - -
- -

Bootstrap includes a responsive, percent-based grid system that appropriately scales up to 12 columns as the device or viewport size increases—in other words, it's mobile first. It includes predefined classes for this, as well as powerful mixins for generating semantic layouts.

- -

Grid example

-

On mobile devices, the grid starts out stacked. Above 768px, it becomes horizontal as media queries kick in to apply floats and widths. To create a basic grid layout, wrap a series of .col-span-* elements within a .row. As this is a 12-column grid, each .span* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent), even at mobile resolutions.

-
-
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
4
-
4
-
4
-
-
-
6
-
6
-
-
-{% highlight html linenos %} -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
4
-
4
-
4
-
-
-
6
-
6
-
-{% endhighlight %} - -

Offsetting columns

-

Move columns to the right using .col-offset-* classes. Each class increases the left margin of a column by a whole column. For example, .col-offset-4 moves .col-span-4 over four columns.

-
-
-
4
-
4 offset 4
-
-
-
3 offset 3
-
3 offset 3
-
-
-
6 offset 6
-
-
-{% highlight html linenos %} -
-
...
-
...
-
-{% endhighlight %} - - -

Nesting columns

-

To nest your content with the default grid, add a new .row and set of .span* columns within an existing .span* column. Nested rows should include a set of columns that add up to 12.

-
-
- Level 1: 9 columns -
-
- Level 2: 6 columns -
-
- Level 2: 6 columns -
-
-
-
-{% highlight html linenos %} -
-
- Level 1: 9 columns -
-
- Level 2: 6 columns -
-
- Level 2: 6 columns -
-
-
-
-{% endhighlight %} - -

Column ordering

-

Easily change the order of our built-in grid columns with .push* and .pull* modifier classes.

-
-
9
-
3
-
- -{% highlight html linenos %} -
-
9
-
3
-
-{% endhighlight %} - -

LESS mixins and variables

-

In addition to prebuilt grid classes for fast layouts, Bootstrap includes LESS variables and mixins for quickly generating your own simple, semantic layouts.

- -

Variables

-

Variables determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.

-{% highlight css linenos %} -@grid-columns: 12; -@grid-gutter-width: 30px; -@grid-float-breakpoint: 768px; -{% endhighlight %} - -

Mixins

-

Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.

-{% highlight css linenos %} -// Creates a wrapper for a series of columns -.make-row() { - // Negative margin the row out to align the content of columns - margin-left: (@grid-gutter-width / -2); - margin-right: (@grid-gutter-width / -2); - // Then clear the floated columns - .clear_float(); -} - -// Generate the columns -.make-column(@columns) { - @media (min-width: @grid-float-breakpoint) { - float: left; - // Calculate width based on number of columns available - width: percentage(@columns / @grid-columns); - } - // Prevent columns from collapsing when empty - min-height: 1px; - // Set inner padding as gutters instead of margin - padding-left: (@grid-gutter-width / 2); - padding-right: (@grid-gutter-width / 2); -} - -// Generate the column offsets -.make-column-offset(@columns) { - @media (min-width: @grid-float-breakpoint) { - margin-left: percentage((@columns / @grid-columns)); - } -} -{% endhighlight %} - -

Example usage

-

You can modify the variables to your own custom values, or just use the mixins with their default values. Here's an example of using the default settings to create a two-column layout with a gap between.

-{% highlight css linenos %} -.wrapper { - .make-row(); -} -.content-main { - .make-column(8); -} -.content-secondary { - .make-column(3); - .make-column-offset(1); -} -{% endhighlight %} -{% highlight html linenos %} -
-
...
-
...
-
-{% endhighlight %} - - - -
- - - - - -
- - - -

Headings

-

All HTML headings, <h1> through <h6> are available.

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

Bootstrap heading

Semibold 38px

Bootstrap heading

Semibold 32px

Bootstrap heading

Semibold 24px

Bootstrap heading

Semibold 18px
Bootstrap heading
Semibold 16px
Bootstrap heading
Semibold 12px
-
- - - -

Body copy

-

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

-
-

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.

-
-{% highlight html linenos %} -

...

-{% endhighlight %} - - -

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.

-
-{% highlight html linenos %} -

...

-{% endhighlight %} - - -

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.

-
-

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

-
-{% highlight html linenos %} -This line of text is meant to be treated as fine print. -{% endhighlight %} - - -

Bold

-

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

-
-

The following snippet of text is rendered as bold text.

-
-{% highlight html linenos %} -rendered as bold text -{% endhighlight %} - -

Italics

-

For emphasizing a snippet of text with italics.

-
-

The following snippet of text is rendered as italicized text.

-
-{% highlight html linenos %} -rendered as italicized text -{% endhighlight %} - -

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.

-
-{% highlight html linenos %} -

Left aligned text.

-

Center aligned text.

-

Right aligned text.

-{% endhighlight %} - -

Emphasis classes

-

Convey meaning through color with a handful of emphasis utility classes.

-
-

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

-

Etiam porta sem malesuada magna mollis euismod.

-

Donec ullamcorper nulla non metus auctor fringilla.

-

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

-
-{% highlight html linenos %} -

...

-

...

-

...

-

...

-{% endhighlight %} - - - -

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.

-
-{% highlight html linenos %} -attr -{% endhighlight %} - -

Initialism

-

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

-
-

HTML is the best thing since sliced bread.

-
-{% highlight html linenos %} -HTML -{% endhighlight %} - - - -

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 -
-
-{% highlight html linenos %} -
- Twitter, Inc.
- 795 Folsom Ave, Suite 600
- San Francisco, CA 94107
- P: (123) 456-7890 -
- -
- Full Name
- first.last@example.com -
-{% endhighlight %} - - - -

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.

-
-
-{% highlight html linenos %} -
-

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

-
-{% endhighlight %} - -

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 -
-
-{% highlight html linenos %} -
-

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

- Someone famous Source Title -
-{% endhighlight %} - -

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 -
-
-{% highlight html linenos %} -
- ... -
-{% endhighlight %} - - - -

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
  • -
-
-{% highlight html linenos %} - -{% endhighlight %} - -

Ordered

-

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

-
-
    -
  1. Lorem ipsum dolor sit amet
  2. -
  3. Consectetur adipiscing elit
  4. -
  5. Integer molestie lorem at massa
  6. -
  7. Facilisis in pretium nisl aliquet
  8. -
  9. Nulla volutpat aliquam velit
  10. -
  11. Faucibus porta lacus fringilla vel
  12. -
  13. Aenean sit amet erat nunc
  14. -
  15. Eget porttitor lorem
  16. -
-
-{% highlight html linenos %} -
    -
  1. ...
  2. -
-{% endhighlight %} - -

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
  • -
-
-{% highlight html linenos %} - -{% endhighlight %} - -

Inline

-

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

-
-
    -
  • Lorem ipsum
  • -
  • Phasellus iaculis
  • -
  • Nulla volutpat
  • -
-
-{% highlight html linenos %} - -{% endhighlight %} - -

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.
-
-
-{% highlight html linenos %} -
-
...
-
...
-
-{% endhighlight %} - -

Horizontal description

-

Make terms and descriptions in <dl> line up side-by-side.

-
-
-
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.
-
-
-{% highlight html linenos %} -
-
...
-
...
-
-{% endhighlight %} - -
Auto-truncating
-

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

-
- - - - - - -
- - -

Inline

-

Wrap inline snippets of code with <code>.

-
- For example, <section> should be wrapped as inline. -
-{% highlight html linenos %} -For example, <section> should be wrapped as inline. -{% endhighlight %} - -

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>
-
-{% highlight html linenos %} -
<p>Sample text here...</p>
-{% endhighlight %} - -

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

-
- - - - -
- - -

Default styles

-

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 NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
-
-{% highlight html linenos %} - - ... -
-{% endhighlight %} - - -

Optional classes

-

Add any of the following classes to the .table base class.

- -

Striped

-

Use .table-striped to add zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not available in IE8).

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
-
-{% highlight html linenos %} - - ... -
-{% endhighlight %} - -

Bordered

-

Add .table-bordered for borders and rounded corners.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
MarkOtto@TwBootstrap
2JacobThornton@fat
3Larry the Bird@twitter
-
-{% highlight html linenos %} - - ... -
-{% endhighlight %} - -

Hover rows

-

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

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
-
-{% highlight html linenos %} - - ... -
-{% endhighlight %} - - -

Condensed

-

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

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
-
-{% highlight html linenos %} - - ... -
-{% endhighlight %} - - - -

Optional row classes

-

Use contextual classes to color table rows.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ClassDescription
- .success - Indicates a successful or positive action.
- .error - Indicates a dangerous or potentially negative action.
- .warning - Indicates a warning that might need attention.
- .info - Used as an alternative to the default styles.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#ProductPayment TakenStatus
1TB - Monthly01/04/2012Approved
2TB - Monthly02/04/2012Declined
3TB - Monthly03/04/2012Pending
-
-{% highlight html linenos %} -... - - 1 - TB - Monthly - 01/04/2012 - Approved - -... -{% endhighlight %} - - - -

Supported table markup

-

List of supported table HTML elements and how they should be used.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TagDescription
- <table> - - Wrapping element for displaying data in a tabular format -
- <thead> - - Container element for table header rows (<tr>) to label table columns -
- <tbody> - - Container element for table rows (<tr>) in the body of the table -
- <tr> - - Container element for a set of table cells (<td> or <th>) that appears on a single row -
- <td> - - Default table cell -
- <th> - - Special table cell for column (or row, depending on scope and placement) labels -
- <caption> - - Description or summary of what the table holds, especially useful for screen readers -
-{% highlight html linenos %} - - - - - - - - - - - - - - - - -
...
.........
.........
-{% endhighlight %} - -
- - - - -
- - -

Default styles

-

Individual form controls automatically receive some global styling. By default, inputs are set to width: 100%;.

-
-
- Legend - - -

Example block-level help text here.

-
- -
- -
-
-{% highlight html linenos %} -
-
- Legend - - -

Example block-level help text here.

-
- -
- -
-
-{% endhighlight %} - - -

Optional layouts

-

Included with Bootstrap are optional form layouts for common use cases.

- -

Inline form

-

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

-
- - -
- -
- -
-{% highlight html linenos %} -
- - -
- -
- -
-{% endhighlight %} - -

Horizontal form

-

Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup changes from a default form:

- -
-
- -
- -
-
-
- -
- -
- -
-
-
-
-
- -
-
-
-{% highlight html linenos %} -
-
- -
- -
-
-
- -
- -
- -
-
-
-
-
- -
-
-
-{% endhighlight %} - - -

Supported form 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.

-

Requires the use of a specified type at all times.

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -

Textarea

-

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

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -

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)

-
-
- -
-
-
- -
-
- -
-
-{% highlight html linenos %} -
- -
- -
- -
-{% endhighlight %} - -

Inline checkboxes

-

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

-
- - - -
-{% highlight html linenos %} - - - -{% endhighlight %} - -

Selects

-

Use the default option or specify a multiple="multiple" to show multiple options at once.

-
- -
- -
-{% highlight html linenos %} - - - -{% endhighlight %} - - - -

Form control 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.

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -

Invalid inputs

-

Style inputs via default browser functionality with :invalid. Specify a type, add the required attribute if the field is not optional, and (if applicable) specify a pattern.

-

This is not available in versions of Internet Explorer 7-9 due to lack of support for CSS pseudo selectors.

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -

Disabled inputs

-

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

-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -

Disabled fieldsets

-

Add the disabled attribute to a <fieldset> to disable all the controls within the <fieldset> at once. Link buttons (with the <a> element) will be aesthetically disabled, but you will need custom JavaScript to disable their behavior.

-
-
-
- -
-
- -
-
- -
- -
-
-{% highlight html linenos %} -
-
-
- -
-
- -
-
- -
- -
-
-{% endhighlight %} - -

Validation states

-

Bootstrap includes validation styles for error, warning, info, and success messages. To use:

- -

Validation styles are applied on a per-input basis. With horizontal forms, the <label class="control-label"> will always be styled.

- -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-{% highlight html linenos %} -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-{% endhighlight %} - - - -

Extending form controls

-

Adding on top of existing browser controls, Bootstrap includes other useful form components.

- -

Input groups

-

Add text or buttons before, after, or on both sides of any text-based input. Use .input-group with a .add-on to prepend or append elements to an <input>.

-

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

-
-
- @ - -
-
-
- - .00 -
-
-
- $ - - .00 -
-
-{% highlight html linenos %} -
- @ - -
- -
- - .00 -
- -
- $ - - .00 -
-{% endhighlight %} - -

Optional sizes

-

Add the relative form sizing classes to the `.input-group-addon`.

-
-
- @ - -
-
-
- @ - -
-
-
- @ - -
-
-{% highlight html linenos %} -
- @ - -
- -
- @ - -
- -
- @ - -
-{% endhighlight %} - -

Buttons instead of text

-

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.

-
-
- - - - -
-
-
- - - - -
-
-{% highlight html linenos %} -
- - - - -
- -
- - - - -
-{% endhighlight %} - -

Button dropdowns

-

-
-
- - -
-
-
- - -
-
-{% highlight html linenos %} - - - -{% endhighlight %} - -

Segmented dropdown groups

-
-
-
- - - -
- -
- -
- -
- -
- - - -
-
-
-{% highlight html linenos %} -
-
- -
- -
- -
- -
- -
-
-{% endhighlight %} - -

Control sizing

-

Use relative sizing classes like .input-large or match your inputs to the grid column sizes using .span* classes.

- -

Relative sizing

-

Create larger or smaller form controls that match button sizes.

-
-
- - - -
-
-{% highlight html linenos %} - - - -{% endhighlight %} - -

Column sizing

-

Use .span1 to .span12 for setting widths on inputs that match Bootstrap's grid system.

-
-
- - - - - - -
-
-{% highlight html linenos %} - - - - - - -{% endhighlight %} - -

If you need multiple inputs on the same line, wrap them in the standard grid markup (with .row and .span* classes). Each input should have it's own column and will expand to fill the available width automatically.

-
-
-
- -
-
- -
-
- -
-
-
-{% highlight html linenos %} -
-
- -
-
- -
-
- -
-
-{% endhighlight %} - -

Uneditable inputs

-

Present data in a form that's not editable without using actual form markup.

-
- Some value here -
-{% highlight html linenos %} -Some value here -{% endhighlight %} - -

Form actions

-

End a form with a group of actions (buttons). When placed within a .form-horizontal, the buttons will automatically indent to line up with the form controls.

-
-
- - -
-
-{% highlight html linenos %} -
- - -
-{% endhighlight %} - -

Help text

-

Inline and block level support for help text that appears around form controls.

-

Inline help

-
- Inline help text -
-{% highlight html linenos %} - -Inline help text -{% endhighlight %} - -

Block help

-
- - A longer block of help text that breaks onto a new line and may extend beyond one line. -
-{% highlight html linenos %} - -A longer block of help text that breaks onto a new line and may extend beyond one line. -{% endhighlight %} - -
- - - - -
- - -

Default buttons

-

Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply these to only <a> and <button> elements for the best rendering.

-
- - - - - - - -
-{% highlight html linenos %} - - - - - - - - - - - - - - - - - - - - -{% endhighlight %} - -

Cross browser compatibility

-

IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled button elements, rendering text gray with a nasty text-shadow that we cannot fix.

- - -

Button sizes

-

Fancy larger or smaller buttons? Add .btn-large, .btn-small, or .btn-mini for additional sizes.

-
-

- - -

-

- - -

-

- - -

-

- - -

-
-{% highlight html linenos %} -

- - -

-

- - -

-

- - -

-

- - -

-{% endhighlight %} - -

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

-
-
- - -
-
-{% highlight html linenos %} - - -{% endhighlight %} - - -

Disabled state

-

Make buttons look unclickable by fading them back 50%.

- -

Button element

-

Add the disabled attribute to <button> buttons.

-

- - -

-{% highlight html linenos %} - - -{% endhighlight %} - -

Anchor element

-

Add the .disabled class to <a> buttons.

-

- Primary link - Link -

-{% highlight html linenos %} -Primary link -Link -{% endhighlight %} -

- We use .disabled as a utility class here, similar to the common .active class, so no prefix is required. Also, this class is only for aesthetic; you must use custom JavaScript to disable links here. -

- - -

One class, multiple tags

-

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

-
- Link - - - -
-{% highlight html linenos %} -Link - - - -{% endhighlight %} -

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

- -
- - - - -
- - -

Add classes to an <img> element to easily style images in any project. Rounded corners are not available in IE8.

-
- - - -
-{% highlight html linenos %} - - - -{% endhighlight %} - -
- - - - -
- - -

Included glyphs

-

Bootstrap comes with all 160 of Glyphicons Halflings set, all available in font formats for easy coloring, sizing, and placement.

- - - -

Glyphicons attribution

-

Glyphicons Halflings are normally not available for free, but an arrangement between Bootstrap and the Glyphicons creator have made this possible at no cost to you as developers. As a thank you, we ask you to include an optional link back to Glyphicons whenever practical.

- - -

How to use

-

Add the appropriate class to any inline element. All icon classes are prefixed with glyphicon- for easy styling. To use, place the following code just about anywhere:

-{% highlight html linenos %} - -{% endhighlight %} -

Want to change the icon color? Just change the color of the parent element.

-

When using beside strings of text, as in buttons or nav links, be sure to leave a space after the icon for proper spacing.

- - -

Icon examples

-

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

- -

Buttons

- -
Button group in a button toolbar
-
-
-
- - - - -
-
-
-{% highlight html linenos %} -
-
- - - - -
-
-{% endhighlight %} - -
Dropdown in a button group
-
- -
-{% highlight html linenos %} - -{% endhighlight %} - -
Large button
-
- Star -
-{% highlight html linenos %} - Star -{% endhighlight %} - -
Small button
-
- -
-{% highlight html linenos %} - -{% endhighlight %} - - -

Navigation

- -{% highlight html linenos %} - -{% endhighlight %} - -

Form fields

-
-
- -
-
- - -
-
-
-
-{% highlight html linenos %} -
- -
-
- - -
-
-
-{% endhighlight %} - -
- - - - -
- -

For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query. Also included are utility classes for toggling content when printed.

- -

Responsive classes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ClassPhones 767px and belowTablets 979px to 768pxDesktops Default
.visible-phoneVisible
.visible-tabletVisible
.visible-desktopVisible
.hidden-phoneVisibleVisible
.hidden-tabletVisibleVisible
.hidden-desktopVisibleVisible
- -

Print classes

- - - - - - - - - - - - - - - - - - - - -
ClassBrowserPrint
.visible-printVisible
.hidden-printVisible
- -

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.

- -

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.

- -

Hidden on...

-

Here, green checkmarks indicate that class is hidden in your current viewport.

- - -
- -
diff --git a/docs/customize.html b/docs/customize.html deleted file mode 100644 index 61a789b1a5..0000000000 --- a/docs/customize.html +++ /dev/null @@ -1,358 +0,0 @@ ---- -layout: default -title: Customize and download ---- - -
-
Customize and download
- -
- -
- - -
-
- -
-
-

Scaffolding

- - - - - -

Base CSS

- - - - - - - -
-
-

Components

- - - - - - - - - - - -

JS Components

- - - - - - -
-
-

Miscellaneous

- - - - -

Responsive

- - - - - -
-
-
- -
- -
-
- - - - - - - -
-
- - - - - - -
-
-

Heads up!

-

All checked plugins will be compiled into a single file, bootstrap.js. All plugins require the latest version of jQuery to be included.

-
-
-
- - -
- -
-
-

Scaffolding

- - - - - -

Links

- - - - - -

Grid system

- - - - - - - - - - - - - - - -
-
- -

Typography

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Tables

- - - - - - - - - -

Forms

- - - - - - - - - - - - - - - - - -
-
- -

Form states & alerts

- - - - - - - - - - - - - - - - - -

Navbar

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Dropdowns

- - - - - - - - - - -
-
-
- -
- -
- Customize and Download -

What's included?

-

Downloads include compiled CSS, compiled and minified CSS, and compiled jQuery plugins, all nicely packed up into a zipball for your convenience.

-
-
-
- - -
diff --git a/docs/docs.html b/docs/docs.html new file mode 100644 index 0000000000..4708907f6e --- /dev/null +++ b/docs/docs.html @@ -0,0 +1,6454 @@ +--- +layout: default +title: Getting started +description: Overview of the project, its contents, and how to get started with a simple template. +--- + +
+ +
+ +
+ + +
+ +

Before downloading, be sure to have a code editor (we recommend Sublime Text 2) and some working knowledge of HTML and CSS. We won't walk through the source files here, but they are available for download. We'll focus on getting started with the compiled Bootstrap files.

+ +
+
+

Compiled

+

Fastest way to get started: get the compiled and minified versions of our CSS, JS, and images. No docs or original source files.

+

Download Bootstrap

+
+
+

Source

+

Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.

+

Download Bootstrap source

+
+
+

Bower

+

Install and manage the original files for all CSS and JavaScript, along with a local copy of the docs, using Bower.

+ {% highlight bash %}bower install bootstrap{% endhighlight %} +
+
+
+ + + + +
+ +

Within the download you'll find the following file structure and contents, logically grouping common assets and providing both compiled and minified variations.

+

Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:

+ +{% highlight bash %} + bootstrap/ + ├── css/ + │ ├── bootstrap.css + │ ├── bootstrap.min.css + ├── js/ + │ ├── bootstrap.js + │ ├── bootstrap.min.js + └── fonts/ + ├── glyphiconshalflings-regular.eot + ├── glyphiconshalflings-regular.otf + ├── glyphiconshalflings-regular.svg + ├── glyphiconshalflings-regular.ttf + └── glyphiconshalflings-regular.woff +{% endhighlight %} + +

This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). The image files are compressed using ImageOptim, a Mac app for compressing PNGs.

+

Please note that all JavaScript plugins require jQuery to be included.

+
+ + + + +
+ +

Bootstrap comes equipped with HTML, CSS, and JS for all sorts of things, but they can be summarized with a handful of categories visible at the top of the Bootstrap documentation.

+ +

Docs sections

+

In addition to the getting started documentation you're reading now, the Bootstrap docs are broken into a few key pages.

+ +

Core CSS

+

Global styles for the body, Normalize, links, grid system, tables, forms, buttons, icons, and more.

+

Components

+

Basic styles for common interface components like tabs and pills, navbar, alerts, page headers, and more. Head here to see what kind of custom components Bootstrap has to offer beyond basic HTML elements.

+

JavaScript plugins

+

Similar to Components, these JavaScript plugins are interactive components for things like tooltips, popovers, modals, and more.

+
+ + + + +
+ +

With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the File structure.

+

Now, here's a look at a typical HTML file:

+ +{% highlight html linenos %} + + + + Bootstrap 101 Template + + + +

Hello, world!

+ + + +{% endhighlight %} + +

To make this a Bootstrapped template, just include the appropriate CSS and JS files:

+ +{% highlight html linenos %} + + + + Bootstrap 101 Template + + + + + +

Hello, world!

+ + + + +{% endhighlight %} + +

And you're set! With those two files added, you can begin to develop any site or application with Bootstrap.

+ +
+ +

Responsive features in IE8

+

Internet Explorer 8 lacks support for media queries, the method by which we deliver responsive CSS to folks. To enable that, you need to include a third party tool (which we include in the project repository) called Respond.js.

+
+<!--[if lt IE 9]>
+  <script src="/assets/js/respond/respond.js"></script>
+<![endif]-->
+
+
+ + + + +
+ +

Move beyond the base template with a few example layouts. We encourage folks to iterate on these examples and not simply use them as an end result.

+
+
+ + + +

Starter template

+

A barebones HTML document with all the Bootstrap CSS and JavaScript included.

+
+
+ + + +

Basic marketing site

+

Featuring a hero unit for a primary message and three supporting elements.

+
+
+ + + +

Narrow marketing

+

Slim, lightweight marketing template for small projects or teams.

+
+
+ + + +

Justified nav

+

Marketing page with equal-width navigation links in a modified navbar.

+
+
+ + + +

Sign in

+

Barebones sign in form with custom, larger form controls and a flexible layout.

+
+
+ + + +

Sticky footer

+

Pin a fixed-height footer to the bottom of the user's viewport.

+
+
+ + + +

Sticky footer w/ navbar

+

Add a fixed navbar to the default sticky footer template.

+
+
+ + + +

Carousel jumbotron

+

An interactive riff on the basic marketing site featuring a prominent carousel.

+
+ + +
+ + + +

Navbar

+

Basic template for showcasing how the navbar works.

+
+
+ + + +

Static top navbar

+

Basic template for showcasing the static navbar variation.

+
+
+ + + +

Fixed top navbar

+

Basic template for showcasing the fixed navbar variation.

+
+
+ + + +

Grid examples

+

+
+
+
+ + + + + +
+ +

Head to the docs for information, examples, and code snippets, or take the next leap and customize Bootstrap for any upcoming project.

+ Visit the Bootstrap docs + Customize Bootstrap +
+ + + + + +
+ +

Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.

+ +

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.

+ +{% highlight html linenos %} + + + ... + +{% endhighlight %} + +

Mobile first

+

With Bootstrap 2, we added optional mobile friendly styles for key aspects of the framework. With Bootstrap 3, we've rewritten the project to be mobile friendly from the start. Instead of adding on optional mobile styles, they're baked right into the core. In fact, Bootstrap is mobile first. Mobile first styles can be found throughout the entire library instead of in separate files.

+

To ensure proper rendering and touch zooming, add the viewport meta tag to your <head>.

+ +{% highlight html linenos %} + +{% endhighlight %} + +

Typography and links

+

Bootstrap sets basic global display, typography, and link styles. Specifically, we:

+ +

These styles can be found within scaffolding.less.

+ +

Normalize reset

+

For improved cross-browser rendering, we use Normalize, a project by Nicolas Gallagher and Jonathan Neal.

+ +
+ + + + +
+ +

Bootstrap includes a responsive, percent-based grid system that appropriately scales up to 12 columns as the device or viewport size increases—in other words, it's mobile first. It includes predefined classes for this, as well as powerful mixins for generating semantic layouts.

+ +

Grid example

+

On mobile devices, the grid starts out stacked. Above 768px, it becomes horizontal as media queries kick in to apply floats and widths. To create a basic grid layout, wrap a series of .col-span-* elements within a .row. As this is a 12-column grid, each .span* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent), even at mobile resolutions.

+
+
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
+
+
4
+
4
+
4
+
+
+
6
+
6
+
+
+{% highlight html linenos %} +
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
1
+
+
+
4
+
4
+
4
+
+
+
6
+
6
+
+{% endhighlight %} + +

Offsetting columns

+

Move columns to the right using .col-offset-* classes. Each class increases the left margin of a column by a whole column. For example, .col-offset-4 moves .col-span-4 over four columns.

+
+
+
4
+
4 offset 4
+
+
+
3 offset 3
+
3 offset 3
+
+
+
6 offset 6
+
+
+{% highlight html linenos %} +
+
...
+
...
+
+{% endhighlight %} + + +

Nesting columns

+

To nest your content with the default grid, add a new .row and set of .span* columns within an existing .span* column. Nested rows should include a set of columns that add up to 12.

+
+
+ Level 1: 9 columns +
+
+ Level 2: 6 columns +
+
+ Level 2: 6 columns +
+
+
+
+{% highlight html linenos %} +
+
+ Level 1: 9 columns +
+
+ Level 2: 6 columns +
+
+ Level 2: 6 columns +
+
+
+
+{% endhighlight %} + +

Column ordering

+

Easily change the order of our built-in grid columns with .push* and .pull* modifier classes.

+
+
9
+
3
+
+ +{% highlight html linenos %} +
+
9
+
3
+
+{% endhighlight %} + +

LESS mixins and variables

+

In addition to prebuilt grid classes for fast layouts, Bootstrap includes LESS variables and mixins for quickly generating your own simple, semantic layouts.

+ +

Variables

+

Variables determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.

+{% highlight css linenos %} +@grid-columns: 12; +@grid-gutter-width: 30px; +@grid-float-breakpoint: 768px; +{% endhighlight %} + +

Mixins

+

Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.

+{% highlight css linenos %} +// Creates a wrapper for a series of columns +.make-row() { + // Negative margin the row out to align the content of columns + margin-left: (@grid-gutter-width / -2); + margin-right: (@grid-gutter-width / -2); + // Then clear the floated columns + .clear_float(); +} + +// Generate the columns +.make-column(@columns) { + @media (min-width: @grid-float-breakpoint) { + float: left; + // Calculate width based on number of columns available + width: percentage(@columns / @grid-columns); + } + // Prevent columns from collapsing when empty + min-height: 1px; + // Set inner padding as gutters instead of margin + padding-left: (@grid-gutter-width / 2); + padding-right: (@grid-gutter-width / 2); +} + +// Generate the column offsets +.make-column-offset(@columns) { + @media (min-width: @grid-float-breakpoint) { + margin-left: percentage((@columns / @grid-columns)); + } +} +{% endhighlight %} + +

Example usage

+

You can modify the variables to your own custom values, or just use the mixins with their default values. Here's an example of using the default settings to create a two-column layout with a gap between.

+{% highlight css linenos %} +.wrapper { + .make-row(); +} +.content-main { + .make-column(8); +} +.content-secondary { + .make-column(3); + .make-column-offset(1); +} +{% endhighlight %} +{% highlight html linenos %} +
+
...
+
...
+
+{% endhighlight %} + + + +
+ + + + + +
+ + + +

Headings

+

All HTML headings, <h1> through <h6> are available.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bootstrap heading

Semibold 38px

Bootstrap heading

Semibold 32px

Bootstrap heading

Semibold 24px

Bootstrap heading

Semibold 18px
Bootstrap heading
Semibold 16px
Bootstrap heading
Semibold 12px
+
+ + + +

Body copy

+

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

+
+

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.

+
+{% highlight html linenos %} +

...

+{% endhighlight %} + + +

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.

+
+{% highlight html linenos %} +

...

+{% endhighlight %} + + +

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.

+
+

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

+
+{% highlight html linenos %} +This line of text is meant to be treated as fine print. +{% endhighlight %} + + +

Bold

+

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

+
+

The following snippet of text is rendered as bold text.

+
+{% highlight html linenos %} +rendered as bold text +{% endhighlight %} + +

Italics

+

For emphasizing a snippet of text with italics.

+
+

The following snippet of text is rendered as italicized text.

+
+{% highlight html linenos %} +rendered as italicized text +{% endhighlight %} + +

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.

+
+{% highlight html linenos %} +

Left aligned text.

+

Center aligned text.

+

Right aligned text.

+{% endhighlight %} + +

Emphasis classes

+

Convey meaning through color with a handful of emphasis utility classes.

+
+

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

+

Etiam porta sem malesuada magna mollis euismod.

+

Donec ullamcorper nulla non metus auctor fringilla.

+

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

+
+{% highlight html linenos %} +

...

+

...

+

...

+

...

+{% endhighlight %} + + + +

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.

+
+{% highlight html linenos %} +attr +{% endhighlight %} + +

Initialism

+

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

+
+

HTML is the best thing since sliced bread.

+
+{% highlight html linenos %} +HTML +{% endhighlight %} + + + +

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 +
+
+{% highlight html linenos %} +
+ Twitter, Inc.
+ 795 Folsom Ave, Suite 600
+ San Francisco, CA 94107
+ P: (123) 456-7890 +
+ +
+ Full Name
+ first.last@example.com +
+{% endhighlight %} + + + +

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.

+
+
+{% highlight html linenos %} +
+

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

+
+{% endhighlight %} + +

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 +
+
+{% highlight html linenos %} +
+

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

+ Someone famous Source Title +
+{% endhighlight %} + +

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 +
+
+{% highlight html linenos %} +
+ ... +
+{% endhighlight %} + + + +

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
  • +
+
+{% highlight html linenos %} + +{% endhighlight %} + +

Ordered

+

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

+
+
    +
  1. Lorem ipsum dolor sit amet
  2. +
  3. Consectetur adipiscing elit
  4. +
  5. Integer molestie lorem at massa
  6. +
  7. Facilisis in pretium nisl aliquet
  8. +
  9. Nulla volutpat aliquam velit
  10. +
  11. Faucibus porta lacus fringilla vel
  12. +
  13. Aenean sit amet erat nunc
  14. +
  15. Eget porttitor lorem
  16. +
+
+{% highlight html linenos %} +
    +
  1. ...
  2. +
+{% endhighlight %} + +

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
  • +
+
+{% highlight html linenos %} + +{% endhighlight %} + +

Inline

+

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

+
+
    +
  • Lorem ipsum
  • +
  • Phasellus iaculis
  • +
  • Nulla volutpat
  • +
+
+{% highlight html linenos %} + +{% endhighlight %} + +

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.
+
+
+{% highlight html linenos %} +
+
...
+
...
+
+{% endhighlight %} + +

Horizontal description

+

Make terms and descriptions in <dl> line up side-by-side.

+
+
+
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.
+
+
+{% highlight html linenos %} +
+
...
+
...
+
+{% endhighlight %} + +
Auto-truncating
+

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

+
+ + + + + + +
+ + +

Inline

+

Wrap inline snippets of code with <code>.

+
+ For example, <section> should be wrapped as inline. +
+{% highlight html linenos %} +For example, <section> should be wrapped as inline. +{% endhighlight %} + +

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>
+
+{% highlight html linenos %} +
<p>Sample text here...</p>
+{% endhighlight %} + +

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

+
+ + + + +
+ + +

Default styles

+

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 NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
+
+{% highlight html linenos %} + + ... +
+{% endhighlight %} + + +

Optional classes

+

Add any of the following classes to the .table base class.

+ +

Striped

+

Use .table-striped to add zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not available in IE8).

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
+
+{% highlight html linenos %} + + ... +
+{% endhighlight %} + +

Bordered

+

Add .table-bordered for borders and rounded corners.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
MarkOtto@TwBootstrap
2JacobThornton@fat
3Larry the Bird@twitter
+
+{% highlight html linenos %} + + ... +
+{% endhighlight %} + +

Hover rows

+

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
+
+{% highlight html linenos %} + + ... +
+{% endhighlight %} + + +

Condensed

+

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
+
+{% highlight html linenos %} + + ... +
+{% endhighlight %} + + + +

Optional row classes

+

Use contextual classes to color table rows.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassDescription
+ .success + Indicates a successful or positive action.
+ .error + Indicates a dangerous or potentially negative action.
+ .warning + Indicates a warning that might need attention.
+ .info + Used as an alternative to the default styles.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#ProductPayment TakenStatus
1TB - Monthly01/04/2012Approved
2TB - Monthly02/04/2012Declined
3TB - Monthly03/04/2012Pending
+
+{% highlight html linenos %} +... + + 1 + TB - Monthly + 01/04/2012 + Approved + +... +{% endhighlight %} + + + +

Supported table markup

+

List of supported table HTML elements and how they should be used.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TagDescription
+ <table> + + Wrapping element for displaying data in a tabular format +
+ <thead> + + Container element for table header rows (<tr>) to label table columns +
+ <tbody> + + Container element for table rows (<tr>) in the body of the table +
+ <tr> + + Container element for a set of table cells (<td> or <th>) that appears on a single row +
+ <td> + + Default table cell +
+ <th> + + Special table cell for column (or row, depending on scope and placement) labels +
+ <caption> + + Description or summary of what the table holds, especially useful for screen readers +
+{% highlight html linenos %} + + + + + + + + + + + + + + + + +
...
.........
.........
+{% endhighlight %} + +
+ + + + +
+ + +

Default styles

+

Individual form controls automatically receive some global styling. By default, inputs are set to width: 100%;.

+
+
+ Legend + + +

Example block-level help text here.

+
+ +
+ +
+
+{% highlight html linenos %} +
+
+ Legend + + +

Example block-level help text here.

+
+ +
+ +
+
+{% endhighlight %} + + +

Optional layouts

+

Included with Bootstrap are optional form layouts for common use cases.

+ +

Inline form

+

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

+
+ + +
+ +
+ +
+{% highlight html linenos %} +
+ + +
+ +
+ +
+{% endhighlight %} + +

Horizontal form

+

Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup changes from a default form:

+ +
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+
+
+ +
+
+
+{% highlight html linenos %} +
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+
+
+ +
+
+
+{% endhighlight %} + + +

Supported form 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.

+

Requires the use of a specified type at all times.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Textarea

+

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

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

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)

+
+
+ +
+
+
+ +
+
+ +
+
+{% highlight html linenos %} +
+ +
+ +
+ +
+{% endhighlight %} + +

Inline checkboxes

+

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

+
+ + + +
+{% highlight html linenos %} + + + +{% endhighlight %} + +

Selects

+

Use the default option or specify a multiple="multiple" to show multiple options at once.

+
+ +
+ +
+{% highlight html linenos %} + + + +{% endhighlight %} + + + +

Form control 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.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Invalid inputs

+

Style inputs via default browser functionality with :invalid. Specify a type, add the required attribute if the field is not optional, and (if applicable) specify a pattern.

+

This is not available in versions of Internet Explorer 7-9 due to lack of support for CSS pseudo selectors.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Disabled inputs

+

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

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Disabled fieldsets

+

Add the disabled attribute to a <fieldset> to disable all the controls within the <fieldset> at once. Link buttons (with the <a> element) will be aesthetically disabled, but you will need custom JavaScript to disable their behavior.

+
+
+
+ +
+
+ +
+
+ +
+ +
+
+{% highlight html linenos %} +
+
+
+ +
+
+ +
+
+ +
+ +
+
+{% endhighlight %} + +

Validation states

+

Bootstrap includes validation styles for error, warning, info, and success messages. To use:

+ +

Validation styles are applied on a per-input basis. With horizontal forms, the <label class="control-label"> will always be styled.

+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+{% highlight html linenos %} +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+{% endhighlight %} + + + +

Extending form controls

+

Adding on top of existing browser controls, Bootstrap includes other useful form components.

+ +

Input groups

+

Add text or buttons before, after, or on both sides of any text-based input. Use .input-group with a .add-on to prepend or append elements to an <input>.

+

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

+
+
+ @ + +
+
+
+ + .00 +
+
+
+ $ + + .00 +
+
+{% highlight html linenos %} +
+ @ + +
+ +
+ + .00 +
+ +
+ $ + + .00 +
+{% endhighlight %} + +

Optional sizes

+

Add the relative form sizing classes to the `.input-group-addon`.

+
+
+ @ + +
+
+
+ @ + +
+
+
+ @ + +
+
+{% highlight html linenos %} +
+ @ + +
+ +
+ @ + +
+ +
+ @ + +
+{% endhighlight %} + +

Buttons instead of text

+

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.

+
+
+ + + + +
+
+
+ + + + +
+
+{% highlight html linenos %} +
+ + + + +
+ +
+ + + + +
+{% endhighlight %} + +

Button dropdowns

+

+
+
+ + +
+
+
+ + +
+
+{% highlight html linenos %} + + + +{% endhighlight %} + +

Segmented dropdown groups

+
+
+
+ + + +
+ +
+ +
+ +
+ +
+ + + +
+
+
+{% highlight html linenos %} +
+
+ +
+ +
+ +
+ +
+ +
+
+{% endhighlight %} + +

Control sizing

+

Use relative sizing classes like .input-large or match your inputs to the grid column sizes using .span* classes.

+ +

Relative sizing

+

Create larger or smaller form controls that match button sizes.

+
+
+ + + +
+
+{% highlight html linenos %} + + + +{% endhighlight %} + +

Column sizing

+

Use .span1 to .span12 for setting widths on inputs that match Bootstrap's grid system.

+
+
+ + + + + + +
+
+{% highlight html linenos %} + + + + + + +{% endhighlight %} + +

If you need multiple inputs on the same line, wrap them in the standard grid markup (with .row and .span* classes). Each input should have it's own column and will expand to fill the available width automatically.

+
+
+
+ +
+
+ +
+
+ +
+
+
+{% highlight html linenos %} +
+
+ +
+
+ +
+
+ +
+
+{% endhighlight %} + +

Uneditable inputs

+

Present data in a form that's not editable without using actual form markup.

+
+ Some value here +
+{% highlight html linenos %} +Some value here +{% endhighlight %} + +

Form actions

+

End a form with a group of actions (buttons). When placed within a .form-horizontal, the buttons will automatically indent to line up with the form controls.

+
+
+ + +
+
+{% highlight html linenos %} +
+ + +
+{% endhighlight %} + +

Help text

+

Inline and block level support for help text that appears around form controls.

+

Inline help

+
+ Inline help text +
+{% highlight html linenos %} + +Inline help text +{% endhighlight %} + +

Block help

+
+ + A longer block of help text that breaks onto a new line and may extend beyond one line. +
+{% highlight html linenos %} + +A longer block of help text that breaks onto a new line and may extend beyond one line. +{% endhighlight %} + +
+ + + + +
+ + +

Default buttons

+

Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply these to only <a> and <button> elements for the best rendering.

+
+ + + + + + + +
+{% highlight html linenos %} + + + + + + + + + + + + + + + + + + + + +{% endhighlight %} + +

Cross browser compatibility

+

IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled button elements, rendering text gray with a nasty text-shadow that we cannot fix.

+ + +

Button sizes

+

Fancy larger or smaller buttons? Add .btn-large, .btn-small, or .btn-mini for additional sizes.

+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+{% highlight html linenos %} +

+ + +

+

+ + +

+

+ + +

+

+ + +

+{% endhighlight %} + +

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

+
+
+ + +
+
+{% highlight html linenos %} + + +{% endhighlight %} + + +

Disabled state

+

Make buttons look unclickable by fading them back 50%.

+ +

Button element

+

Add the disabled attribute to <button> buttons.

+

+ + +

+{% highlight html linenos %} + + +{% endhighlight %} + +

Anchor element

+

Add the .disabled class to <a> buttons.

+

+ Primary link + Link +

+{% highlight html linenos %} +Primary link +Link +{% endhighlight %} +

+ We use .disabled as a utility class here, similar to the common .active class, so no prefix is required. Also, this class is only for aesthetic; you must use custom JavaScript to disable links here. +

+ + +

One class, multiple tags

+

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

+
+ Link + + + +
+{% highlight html linenos %} +Link + + + +{% endhighlight %} +

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

+ +
+ + + + +
+ + +

Add classes to an <img> element to easily style images in any project. Rounded corners are not available in IE8.

+
+ + + +
+{% highlight html linenos %} + + + +{% endhighlight %} + +
+ + + + +
+ + +

Included glyphs

+

Bootstrap comes with all 160 of Glyphicons Halflings set, all available in font formats for easy coloring, sizing, and placement.

+ + + +

Glyphicons attribution

+

Glyphicons Halflings are normally not available for free, but an arrangement between Bootstrap and the Glyphicons creator have made this possible at no cost to you as developers. As a thank you, we ask you to include an optional link back to Glyphicons whenever practical.

+ + +

How to use

+

Add the appropriate class to any inline element. All icon classes are prefixed with glyphicon- for easy styling. To use, place the following code just about anywhere:

+{% highlight html linenos %} + +{% endhighlight %} +

Want to change the icon color? Just change the color of the parent element.

+

When using beside strings of text, as in buttons or nav links, be sure to leave a space after the icon for proper spacing.

+ + +

Icon examples

+

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

+ +

Buttons

+ +
Button group in a button toolbar
+
+
+
+ + + + +
+
+
+{% highlight html linenos %} +
+
+ + + + +
+
+{% endhighlight %} + +
Dropdown in a button group
+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +
Large button
+
+ Star +
+{% highlight html linenos %} + Star +{% endhighlight %} + +
Small button
+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + + +

Navigation

+ +{% highlight html linenos %} + +{% endhighlight %} + +

Form fields

+
+
+ +
+
+ + +
+
+
+
+{% highlight html linenos %} +
+ +
+
+ + +
+
+
+{% endhighlight %} + +
+ + + + +
+ +

For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query. Also included are utility classes for toggling content when printed.

+ +

Responsive classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassPhones 767px and belowTablets 979px to 768pxDesktops Default
.visible-phoneVisible
.visible-tabletVisible
.visible-desktopVisible
.hidden-phoneVisibleVisible
.hidden-tabletVisibleVisible
.hidden-desktopVisibleVisible
+ +

Print classes

+ + + + + + + + + + + + + + + + + + + + +
ClassBrowserPrint
.visible-printVisible
.hidden-printVisible
+ +

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.

+ +

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.

+ +

Hidden on...

+

Here, green checkmarks indicate that class is hidden in your current viewport.

+ + +
+ + + + + + + + + + + + +
+ +

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.

+ +

Single button group

+

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

+
+
+ + + +
+
+{% highlight html linenos %} +
+ + + +
+{% endhighlight %} + +

Multiple button groups

+

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

+
+
+
+ + + + +
+
+ + + +
+
+ +
+
+
+{% highlight html linenos %} +
+
...
+
...
+
...
+
+{% endhighlight %} + +

Vertical button groups

+

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

+
+
+ + + + +
+
+{% highlight html linenos %} +
+ ... +
+{% endhighlight %} + +

Justified button groups

+

Make a group of buttons stretch at the same size to span the entire width of its parent. This only works with <a> elements as the <button> doesn't pick up these styles.

+
+
+ Left + Right + Middle +
+
+{% highlight html linenos %} +
+ ... +
+{% endhighlight %} + +
+ + + + +
+ +

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

+ +

Single or split button

+

Turn a button into dropdown toggle, or add a second button to toggle the dropdown while retaining the primary button action.

+ +{% highlight html linenos %} + + + + + +{% endhighlight %} + +

Works with all button sizes

+

Button dropdowns work at any size: .btn-large, .btn-small, or .btn-mini.

+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+{% highlight html linenos %} + +
+ + +
+ + +
+ + +
+ + +
+ + +
+{% endhighlight %} + +

Dropup buttons

+

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

+
+
+ +
+ + + +
+
+
+{% highlight html linenos %} +
+ + + +
+{% endhighlight %} + +
+ + + + + + + + + + + + + + + + + + + +
+ +

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

+ +

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.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Disabled and active states

+

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

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} +

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

+{% highlight html linenos %} + +{% endhighlight %} + + +

Sizes

+

Fancy larger or smaller pagination? Add .pagination-large, .pagination-small, or .pagination-mini for additional sizes.

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+{% highlight html linenos %} + + + + +{% endhighlight %} + + +

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.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Aligned links

+

Alternatively, you can align each link to the sides:

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + + +

Optional disabled state

+

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

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + + +
+ + + + +
+ +

+ +

Example

+
+

Example heading New

+

Example heading New

+

Example heading New

+

Example heading New

+
Example heading New
+
Example heading New
+
+{% highlight html linenos %} +

Example heading New

+{% endhighlight %} + +

Available variations

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LabelsMarkup
+ Default + + <span class="label">Default</span> +
+ Success + + <span class="label label-success">Success</span> +
+ Warning + + <span class="label label-warning">Warning</span> +
+ Danger + + <span class="label label-danger">Danger</span> +
+ Info + + <span class="label label-info">Info</span> +
+ +
+ + + + +
+ +

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

+ +
+ Inbox 42 +
+{% highlight html linenos %} +Inbox 42 +{% endhighlight %} + +

Self collapsing

+

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

+ +

Adapts to active nav states

+

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

+ +{% highlight html linenos %} + +{% endhighlight %} + +
+ + + + +
+ + +

Jumbotron

+

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.

+

Learn more

+
+
+{% highlight html linenos %} +
+

Hello, world!

+

...

+

Learn more

+
+{% endhighlight %} + +

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

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +
+ + + + +
+ +

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

+ +

Default thumbnails

+

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

+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+{% highlight html linenos %} +
+
+ + + +
+ ... +
+{% endhighlight %} + +

Custom content thumbnails

+

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

+
+
+
+
+ +
+

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.

+

Action Action

+
+
+
+
+
+ +
+

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.

+

Action Action

+
+
+
+
+
+ +
+

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.

+

Action Action

+
+
+
+
+
+{% highlight html linenos %} +
+
+
+ +
+

Thumbnail label

+

...

+

Action Action

+
+
+
+
+{% endhighlight %} + + +
+ + + + + +
+ +

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.

+ +

Default alert

+

Wrap any text and an optional dismiss button in .alert for a basic warning alert message. To ensure proper behavior across all devices, be sure to use <button> element with the data-dismiss="alert" data attribute.

+
+
+ + Warning! Best check yo self, you're not looking too good. +
+
+{% highlight html linenos %} +
+ + Warning! Best check yo self, you're not looking too good. +
+{% endhighlight %} + +

Block alerts

+

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.

+
+
+{% highlight html linenos %} +
+ +

Warning!

+

...

+
+{% endhighlight %} + +

Contextual alternatives

+

Add optional classes to change an alert's connotation.

+
+
+ + Oh snap! Change a few things up and try submitting again. +
+
+ + Well done! You successfully read this important alert message. +
+
+ + Heads up! This alert needs your attention, but it's not super important. +
+
+{% highlight html linenos %} +
...
+
...
+
...
+{% endhighlight %} +
+ + + + + +
+ +

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

+ +

Progress bars use CSS3 transitions and animations to achieve some of their effects. These features are not supported in IE8-9 or older versions of Firefox. Internet Explorer 10 and below, as well as Opera 12, do not support animations.

+ +

Basic

+

Default progress bar with a vertical gradient.

+
+
+
+
+
+{% highlight html linenos %} +
+
+
+{% endhighlight %} + +

Additional colors

+

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

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% highlight html linenos %} +
+
+
+
+
+
+
+
+
+
+
+
+{% endhighlight %} + +

Striped

+

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

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% highlight html linenos %} +
+
+
+
+
+
+
+
+
+
+
+
+{% endhighlight %} + +

Animated

+

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

+
+
+
+
+
+{% highlight html linenos %} +
+
+
+{% endhighlight %} + +

Stacked

+

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

+
+
+
+
+
+
+
+{% highlight html linenos %} +
+
+
+
+
+{% endhighlight %} + +
+ + + + + +
+ +

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

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

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. +
+
+
+
+
+{% highlight html linenos %} +
+ + + +
+

Media heading

+ ... +
+
+{% endhighlight %} + +

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.

    + +
    + + + +
    +

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

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

    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. +
    +
    +
    +
  • +
  • + + + +
    +

    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. +
    +
  • +
+
+{% highlight html linenos %} + +{% endhighlight %} + +
+ + + + + + +
+ + +

Wells

+

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

+
+
+ Look, I'm in a well! +
+
+{% highlight html linenos %} +
...
+{% endhighlight %} +

Optional classes

+

Control padding and rounded corners with two optional modifier classes.

+
+
+ Look, I'm in a well! +
+
+{% highlight html linenos %} +
...
+{% endhighlight %} + +
+
+ Look, I'm in a well! +
+
+{% highlight html linenos %} +
...
+{% endhighlight %} + + +

Close icon

+

Use the generic close icon for dismissing content like modals and alerts.

+
+

+
+{% highlight html linenos %} + +{% endhighlight %} + +

Helper classes

+

Simple, focused classes for small display or behavior tweaks.

+ +

.pull-left

+

Float an element left

+{% highlight html linenos %} +
...
+{% endhighlight %} +{% highlight css linenos %} +.pull-left { + float: left; +} +{% endhighlight %} + +

.pull-right

+

Float an element right

+{% highlight html linenos %} +
...
+{% endhighlight %} +{% highlight css linenos %} +.pull-right { + float: right; +} +{% endhighlight %} + +

.muted

+

Change an element's color to #999

+{% highlight html linenos %} +

...

+{% endhighlight %} +{% highlight css linenos %} +.muted { + color: #999; +} +{% endhighlight %} + + +

.clearfix

+

Clear the float on any element. Utilizes the micro clearfix as popularized by Nicolas Gallagher.

+{% highlight html linenos %} +
...
+{% endhighlight %} +{% highlight css linenos %} +.clearfix { + &:before, + &:after { + content: " "; + display: table; + } + &:after { + clear: both; + } +} +{% endhighlight %} + + +
+ + + + + +
+ + +

Individual or compiled

+

Plugins can be included individually (though some have required dependencies), or all at once. Both bootstrap.js and bootstrap.min.js contain all plugins in a single file.

+ +

Data attributes

+

You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.

+ +

That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: +{% highlight js linenos %} +$('body').off('.data-api') +{% endhighlight %} + +

Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:

+{% highlight js linenos %} +$('body').off('.alert.data-api') +{% endhighlight %} + +

Programmatic API

+

We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.

+{% highlight js linenos %} +$(".btn.danger").button("toggle").addClass("fat") +{% endhighlight %} + +

All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):

+{% highlight js linenos %} +$("#myModal").modal() // initialized with defaults +$("#myModal").modal({ keyboard: false }) // initialized with no keyboard +$("#myModal").modal('show') // initializes and invokes show immediately

+{% endhighlight %} + +

Each plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').

+ +

No conflict

+

Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call .noConflict on the plugin you wish to revert the value of.

+{% highlight js linenos %} +var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value +$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionality +{% endhighlight %} + + +

Events

+

Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and its past participle form (ex. shown) is trigger on the completion of an action.

+

All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.

+{% highlight js linenos %} +$('#myModal').on('show', function (e) { + if (!data) return e.preventDefault() // stops modal from being shown +}) +{% endhighlight %} + +
+ + + + +
+ +

About transitions

+

For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

+

Use cases

+

A few examples of the transition plugin:

+ + + +
+ + + + +
+ + + +

Examples

+

Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

+ +

Static example

+

A rendered modal with header, body, and set of actions in the footer.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Live demo

+

Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.

+ + + + +{% highlight html linenos %} + +{% endhighlight %} + + + +

Usage

+ +

Via data attributes

+

Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.

+{% highlight html linenos %} + +{% endhighlight %} + +

Via JavaScript

+

Call a modal with id myModal with a single line of JavaScript:

+ {% highlight js linenos %}$('#myModal').modal(options){% endhighlight %} + +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-backdrop="".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
backdropbooleantrueIncludes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.
keyboardbooleantrueCloses the modal when escape key is pressed
showbooleantrueShows the modal when initialized.
remotepathfalse

If a remote url is provided, content will be loaded via jQuery's load method and injected into the .modal-body. If you're using the data api, you may alternatively use the href tag to specify the remote source. An example of this is shown below:

+{% highlight html linenos %} +Click me +{% endhighlight %} +
+ +

Methods

+ +

.modal(options)

+

Activates your content as a modal. Accepts an optional options object.

+{% highlight js linenos %} +$('#myModal').modal({ + keyboard: false +}) +{% endhighlight %} + +

.modal('toggle')

+

Manually toggles a modal.

+ {% highlight js linenos %}$('#myModal').modal('toggle'){% endhighlight %} + +

.modal('show')

+

Manually opens a modal.

+ {% highlight js linenos %}$('#myModal').modal('show'){% endhighlight %} + +

.modal('hide')

+

Manually hides a modal.

+ {% highlight js linenos %}$('#myModal').modal('hide'){% endhighlight %} + +

Events

+

Bootstrap's modal class exposes a few events for hooking into modal functionality.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
EventDescription
showThis event fires immediately when the show instance method is called.
shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).
hideThis event is fired immediately when the hide instance method has been called.
hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
+{% highlight js linenos %} +$('#myModal').on('hidden', function () { + // do something… +}) +{% endhighlight %} +
+ + + + + + + + + +
+ + + +

Example in navbar

+

The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.

+
+ +
+

@fat

+

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

+

@mdo

+

Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.

+

one

+

Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.

+

two

+

In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.

+

three

+

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

+

Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. +

+
+
+ + +
+ + +

Usage

+ +

Via data attributes

+

To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body) and data-target=".navbar" to select which nav to use. You'll want to use scrollspy with a .nav component.

+{% highlight html linenos %} + + ... + +{% endhighlight %} + +

Via JavaScript

+

Call the scrollspy via JavaScript:

+{% highlight js linenos %} +$('.navbar').scrollspy() +{% endhighlight %} + +
+ Heads up! + Navbar links must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>. +
+ +

Methods

+

.scrollspy('refresh')

+

When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:

+{% highlight js linenos %} +$('[data-spy="scroll"]').each(function () { + var $spy = $(this).scrollspy('refresh') +}); +{% endhighlight %} + + +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset="".

+ + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
offsetnumber10Pixels to offset from top when calculating position of scroll.
+ +

Events

+ + + + + + + + + + + + + +
EventDescription
activateThis event fires whenever a new item becomes activated by the scrollspy.
+
+ + + + +
+ + + +

Example tabs

+

Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.

+
+ +
+
+

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

+
+
+

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

+
+ + +
+
+ + +
+ + +

Usage

+

Enable tabbable tabs via JavaScript (each tab needs to be activated individually):

+{% highlight js linenos %} +$('#myTab a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); +}) +{% endhighlight %} + +

You can activate individual tabs in several ways:

+{% highlight js linenos %} +$('#myTab a[href="#profile"]').tab('show'); // Select tab by name +$('#myTab a:first').tab('show'); // Select first tab +$('#myTab a:last').tab('show'); // Select last tab +$('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed) +{% endhighlight %} + +

Markup

+

You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling.

+{% highlight html linenos %} + +{% endhighlight %} + +

To make tabs fade in, add .fade to each .tab-pane.

+ +

Methods

+

$().tab

+

+ Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM. +

+{% highlight html linenos %} + + +
+
...
+
...
+
...
+
...
+
+ + +{% endhighlight %} + +

Events

+ + + + + + + + + + + + + + + + + +
EventDescription
showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
+{% highlight js linenos %} +$('a[data-toggle="tab"]').on('shown', function (e) { + e.target // activated tab + e.relatedTarget // previous tab +}) +{% endhighlight %} +
+ + + +
+ + + +

Examples

+

Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.

+

Hover over the links below to see tooltips:

+
+

Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. +

+
+ +

Four directions

+ + + +

Tooltips in input groups

+

When using tooltips and popovers with the Bootstrap input groups, you'll have to set the container (documented below) option to avoid unwanted side effects.

+ +
+ + +

Usage

+

Trigger the tooltip via JavaScript:

+{% highlight js linenos %} +$('#example').tooltip(options) +{% endhighlight %} + +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleanfalseInsert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring | function'top'how to position the tooltip - top | bottom | left | right
selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
titlestring | function''default title value if `title` tag isn't present
triggerstring'hover focus'how tooltip is triggered - click | hover | focus | manual. Note you case pass trigger multiple, space seperated, trigger types.
delaynumber | object0 +

delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

+

If a number is supplied, delay is applied to both hide/show

+

Object structure is: delay: { show: 500, hide: 100 }

+
containerstring | falsefalse +

Appends the tooltip to a specific element container: 'body'

+
+
+ Heads up! + Options for individual tooltips can alternatively be specified through the use of data attributes. +
+ +

Markup

+{% highlight html linenos %} +Hover over me +{% endhighlight %} + +

Methods

+ +

$().tooltip(options)

+

Attaches a tooltip handler to an element collection.

+ +

.tooltip('show')

+

Reveals an element's tooltip.

+ {% highlight js linenos %}$('#element').tooltip('show'){% endhighlight %} + +

.tooltip('hide')

+

Hides an element's tooltip.

+ {% highlight js linenos %}$('#element').tooltip('hide'){% endhighlight %} + +

.tooltip('toggle')

+

Toggles an element's tooltip.

+ {% highlight js linenos %}$('#element').tooltip('toggle'){% endhighlight %} + +

.tooltip('destroy')

+

Hides and destroys an element's tooltip.

+ {% highlight js linenos %}$('#element').tooltip('destroy'){% endhighlight %} +
+ + + + +
+ + +

Examples

+

Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

+ +

Static popover

+

Four options are available: top, right, bottom, and left aligned.

+
+
+
+

Popover top

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+

Popover right

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+

Popover bottom

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+

Popover left

+
+

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

+
+
+ +
+
+

No markup shown as popovers are generated from JavaScript and content within a data attribute.

+ +

Live demo

+ + +

Four directions

+ + + +
+ + +

Usage

+

Enable popovers via JavaScript:

+ {% highlight js linenos %}$('#example').popover(options){% endhighlight %} + +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleanfalseInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring | function'right'how to position the popover - top | bottom | left | right
selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
triggerstring'click'how popover is triggered - click | hover | focus | manual
titlestring | function''default title value if `title` attribute isn't present
contentstring | function''default content value if `data-content` attribute isn't present
delaynumber | object0 +

delay showing and hiding the popover (ms) - does not apply to manual trigger type

+

If a number is supplied, delay is applied to both hide/show

+

Object structure is: delay: { show: 500, hide: 100 }

+
containerstring | falsefalse +

Appends the popover to a specific element container: 'body'

+
+
+ Heads up! + Options for individual popovers can alternatively be specified through the use of data attributes. +
+ +

Markup

+

For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

+ +

Methods

+

$().popover(options)

+

Initializes popovers for an element collection.

+ +

.popover('show')

+

Reveals an elements popover.

+ {% highlight js linenos %}$('#element').popover('show'){% endhighlight %} + +

.popover('hide')

+

Hides an elements popover.

+ {% highlight js linenos %}$('#element').popover('hide'){% endhighlight %} + +

.popover('toggle')

+

Toggles an elements popover.

+ {% highlight js linenos %}$('#element').popover('toggle'){% endhighlight %} + +

.popover('destroy')

+

Hides and destroys an element's popover.

+ {% highlight js linenos %}$('#element').popover('destroy'){% endhighlight %} +
+ + + + +
+ + + +

Example alerts

+

Add dismiss functionality to all alert messages with this plugin.

+
+
+ + Holy guacamole! Best check yo self, you're not looking too good. +
+
+ +
+
+ +

Oh snap! You got an error!

+

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

+

+ Take this action Or do this +

+
+
+ + +
+ + +

Usage

+

Enable dismissal of an alert via JavaScript:

+ {% highlight js linenos %}$(".alert").alert(){% endhighlight %} + +

Markup

+

Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

+ {% highlight html linenos %}×{% endhighlight %} + +

Methods

+ +

$().alert()

+

Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

+ +

.alert('close')

+

Closes an alert.

+ {% highlight js linenos %}$(".alert").alert('close'){% endhighlight %} + + +

Events

+

Bootstrap's alert class exposes a few events for hooking into alert functionality.

+ + + + + + + + + + + + + + + + + +
EventDescription
closeThis event fires immediately when the close instance method is called.
closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
+{% highlight js linenos %} +$('#my-alert').bind('closed', function () { + // do something… +}) +{% endhighlight %} +
+ + + + +
+ + +

Example uses

+

Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

+ +

Stateful

+

Add data-loading-text="Loading..." to use a loading state on a button.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Single toggle

+

Add data-toggle="button" to activate toggling on a single button.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

Checkbox

+

Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

+
+
+ + + +
+
+{% highlight html linenos %} +
+ + + +
+{% endhighlight %} + +

Radio

+

Add data-toggle="buttons-radio" for radio style toggling on btn-group.

+
+
+ + + +
+
+{% highlight html linenos %} +
+ + + +
+{% endhighlight %} + + +
+ + +

Usage

+

Enable buttons via JavaScript:

+{% highlight js linenos %} +$('.nav-tabs').button() +{% endhighlight %} + +

Markup

+

Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

+ +

Options

+

None

+ +

Methods

+ +

$().button('toggle')

+

Toggles push state. Gives the button the appearance that it has been activated.

+
+ Heads up! + You can enable auto toggling of a button by using the data-toggle attribute. +
+{% highlight html linenos %} + +{% endhighlight %} + +

$().button('loading')

+

Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. +

+{% highlight html linenos %} + +{% endhighlight %} + +
+ Heads up! + Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off". +
+ +

$().button('reset')

+

Resets button state - swaps text to original text.

+ +

$().button(string)

+

Resets button state - swaps text to any data defined text state.

+{% highlight html linenos %} + + +{% endhighlight %} +
+ + + + +
+ + +

About

+

Get base styles and flexible support for collapsible components like accordions and navigation.

+

* Requires the Transitions plugin to be included.

+ +

Example accordion

+

Using the collapse plugin, we built a simple accordion style widget:

+ +
+
+
+ +
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+
+
+
+ +
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+
+
+
+ +
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+
+
+
+
+{% highlight html linenos %} +
+
+ +
+
+ ... +
+
+
+
+ +
+
+ ... +
+
+
+
+ +
+
+ ... +
+
+
+
+{% endhighlight %} + +

You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.

+{% highlight html linenos %} + + +
...
+{% endhighlight %} + + +
+ + +

Usage

+ +

Via data attributes

+

Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

+

To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

+ +

Via JavaScript

+

Enable manually with:

+{% highlight js linenos %} +$(".collapse").collapse() +{% endhighlight %} + +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-parent="".

+ + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
togglebooleantrueToggles the collapsible element on invocation
+ + +

Methods

+ +

.collapse(options)

+

Activates your content as a collapsible element. Accepts an optional options object. +{% highlight js linenos %} +$('#myCollapsible').collapse({ + toggle: false +}) +{% endhighlight %} + +

.collapse('toggle')

+

Toggles a collapsible element to shown or hidden.

+ +

.collapse('show')

+

Shows a collapsible element.

+ +

.collapse('hide')

+

Hides a collapsible element.

+ +

Events

+

Bootstrap's collapse class exposes a few events for hooking into collapse functionality.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
EventDescription
showThis event fires immediately when the show instance method is called.
shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
hide + This event is fired immediately when the hide method has been called. +
hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
+{% highlight js linenos %} +$('#myCollapsible').on('hidden', function () { + // do something… +}) +{% endhighlight %} +
+ + + + + + + + + +
+ + + +

Example

+

A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

+
+ +
+{% highlight html linenos %} + +{% endhighlight %} + +

You'll want to set autocomplete="off" to prevent default browser menus from appearing over the Bootstrap typeahead dropdown.

+ +
+ + +

Usage

+ +

Via data attributes

+

Add data attributes to register an element with typeahead functionality as shown in the example above.

+ +

Via JavaScript

+

Call the typeahead manually with:

+{% highlight js linenos %} +$('.typeahead').typeahead() +{% endhighlight %} + +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-source="".

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
sourcearray, function[ ]The data source to query against. May be an array of strings or a function. The function is passed two arguments, the query value in the input field and the process callback. The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.
itemsnumber8The max number of items to display in the dropdown.
minLengthnumber1The minimum character length needed before triggering autocomplete suggestions
matcherfunctioncase insensitiveThe method used to determine if a query matches an item. Accepts a single argument, the item against which to test the query. Access the current query with this.query. Return a boolean true if query is a match.
sorterfunctionexact match,
case sensitive,
case insensitive
Method used to sort autocomplete results. Accepts a single argument items and has the scope of the typeahead instance. Reference the current query with this.query.
updaterfunctionreturns selected itemThe method used to return selected item. Accepts a single argument, the item and has the scope of the typeahead instance.
highlighterfunctionhighlights all default matchesMethod used to highlight autocomplete results. Accepts a single argument item and has the scope of the typeahead instance. Should return html.
+ +

Methods

+

.typeahead(options)

+

Initializes an input with a typeahead.

+
+ + + + +
+ + +

Example

+

The subnavigation on the left is a live demo of the affix plugin.

+ +
+ +

Usage

+ +

Via data attributes

+

To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.

+ +{% highlight html linenos %} +
...
+{% endhighlight %} + +
+ Heads up! + You must manage the position of a pinned element and the behavior of its immediate parent. Position is controlled by affix, affix-top, and affix-bottom. Remember to check for a potentially collapsed parent when the affix kicks in as it's removing content from the normal flow of the page. +
+ +

Via JavaScript

+

Call the affix plugin via JavaScript:

+{% highlight js linenos %} +$('#navbar').affix() +{% endhighlight %} + +

Methods

+

.affix('refresh')

+

When using affix in conjunction with adding or removing of elements from the DOM, you'll want to call the refresh method:

+{% highlight js linenos %} +$('[data-spy="affix"]').each(function () { + $(this).affix('refresh') +}); +{% endhighlight %} + +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset-top="200".

+ + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
offsetnumber | function | object10Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and left directions. To listen for a single direction, or multiple unique offsets, just provide an object offset: { x: 10 }. Use a function when you need to dynamically provide an offset (useful for some responsive designs).
+
+ +
diff --git a/docs/getting-started.html b/docs/getting-started.html deleted file mode 100644 index a2b3ba5144..0000000000 --- a/docs/getting-started.html +++ /dev/null @@ -1,270 +0,0 @@ ---- -layout: default -title: Getting started -description: Overview of the project, its contents, and how to get started with a simple template. ---- - -
-
Getting started
- -
- -
- - -
- -

Before downloading, be sure to have a code editor (we recommend Sublime Text 2) and some working knowledge of HTML and CSS. We won't walk through the source files here, but they are available for download. We'll focus on getting started with the compiled Bootstrap files.

- -
-
-

Compiled

-

Fastest way to get started: get the compiled and minified versions of our CSS, JS, and images. No docs or original source files.

-

Download Bootstrap

-
-
-

Source

-

Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.

-

Download Bootstrap source

-
-
-

Bower

-

Install and manage the original files for all CSS and JavaScript, along with a local copy of the docs, using Bower.

- {% highlight bash %}bower install bootstrap{% endhighlight %} -
-
-
- - - - -
- -

Within the download you'll find the following file structure and contents, logically grouping common assets and providing both compiled and minified variations.

-

Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:

- -{% highlight bash %} - bootstrap/ - ├── css/ - │ ├── bootstrap.css - │ ├── bootstrap.min.css - ├── js/ - │ ├── bootstrap.js - │ ├── bootstrap.min.js - └── fonts/ - ├── glyphiconshalflings-regular.eot - ├── glyphiconshalflings-regular.otf - ├── glyphiconshalflings-regular.svg - ├── glyphiconshalflings-regular.ttf - └── glyphiconshalflings-regular.woff -{% endhighlight %} - -

This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). The image files are compressed using ImageOptim, a Mac app for compressing PNGs.

-

Please note that all JavaScript plugins require jQuery to be included.

-
- - - - -
- -

Bootstrap comes equipped with HTML, CSS, and JS for all sorts of things, but they can be summarized with a handful of categories visible at the top of the Bootstrap documentation.

- -

Docs sections

-

In addition to the getting started documentation you're reading now, the Bootstrap docs are broken into a few key pages.

- -

Core CSS

-

Global styles for the body, Normalize, links, grid system, tables, forms, buttons, icons, and more.

-

Components

-

Basic styles for common interface components like tabs and pills, navbar, alerts, page headers, and more. Head here to see what kind of custom components Bootstrap has to offer beyond basic HTML elements.

-

JavaScript plugins

-

Similar to Components, these JavaScript plugins are interactive components for things like tooltips, popovers, modals, and more.

-
- - - - -
- -

With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the File structure.

-

Now, here's a look at a typical HTML file:

- -{% highlight html linenos %} - - - - Bootstrap 101 Template - - - -

Hello, world!

- - - -{% endhighlight %} - -

To make this a Bootstrapped template, just include the appropriate CSS and JS files:

- -{% highlight html linenos %} - - - - Bootstrap 101 Template - - - - - -

Hello, world!

- - - - -{% endhighlight %} - -

And you're set! With those two files added, you can begin to develop any site or application with Bootstrap.

- -
- -

Responsive features in IE8

-

Internet Explorer 8 lacks support for media queries, the method by which we deliver responsive CSS to folks. To enable that, you need to include a third party tool (which we include in the project repository) called Respond.js.

-
-<!--[if lt IE 9]>
-  <script src="/assets/js/respond/respond.js"></script>
-<![endif]-->
-
-
- - - - -
- -

Move beyond the base template with a few example layouts. We encourage folks to iterate on these examples and not simply use them as an end result.

-
-
- - - -

Starter template

-

A barebones HTML document with all the Bootstrap CSS and JavaScript included.

-
-
- - - -

Basic marketing site

-

Featuring a hero unit for a primary message and three supporting elements.

-
-
- - - -

Narrow marketing

-

Slim, lightweight marketing template for small projects or teams.

-
-
- - - -

Justified nav

-

Marketing page with equal-width navigation links in a modified navbar.

-
-
- - - -

Sign in

-

Barebones sign in form with custom, larger form controls and a flexible layout.

-
-
- - - -

Sticky footer

-

Pin a fixed-height footer to the bottom of the user's viewport.

-
-
- - - -

Sticky footer w/ navbar

-

Add a fixed navbar to the default sticky footer template.

-
-
- - - -

Carousel jumbotron

-

An interactive riff on the basic marketing site featuring a prominent carousel.

-
- - -
- - - -

Navbar

-

Basic template for showcasing how the navbar works.

-
-
- - - -

Static top navbar

-

Basic template for showcasing the static navbar variation.

-
-
- - - -

Fixed top navbar

-

Basic template for showcasing the fixed navbar variation.

-
-
- - - -

Grid examples

-

-
-
-
- - - - - -
- -

Head to the docs for information, examples, and code snippets, or take the next leap and customize Bootstrap for any upcoming project.

- Visit the Bootstrap docs - Customize Bootstrap -
- -
diff --git a/docs/index.html b/docs/index.html index d2aece152b..f8d72f3f25 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,5 +1,5 @@ --- -layout: default +layout: home title: Bootstrap --- @@ -9,6 +9,7 @@ title: Bootstrap

Sleek, intuitive, and powerful mobile-first front-end framework for faster and easier web development.

Download Bootstrap + View docs