From 4b1ff7fa49361fd4a13341767d53231fc9ecef21 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 12 Jan 2014 00:04:24 -0800 Subject: Formatting and docs changes --- docs/css.html | 3638 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 1804 insertions(+), 1834 deletions(-) (limited to 'docs/css.html') diff --git a/docs/css.html b/docs/css.html index f4282b9cb..98a18f062 100644 --- a/docs/css.html +++ b/docs/css.html @@ -6,16 +6,15 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e --- - -
- -

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

+ +
+

Overview

+ +

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

-

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.

+

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 %} @@ -23,74 +22,73 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e {% 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>.

+

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 %} {% endhighlight %} -

You can disable zooming capabilities on mobile devices by adding user-scalable=no to the viewport meta tag. This disables zooming, meaning users are only able to scroll, and results in your site feeling a bit more like a native application. Overall we don't recommend this on every site, so use caution!

+

You can disable zooming capabilities on mobile devices by adding user-scalable=no to the viewport meta tag. This disables zooming, meaning users are only able to scroll, and results in your site feeling a bit more like a native application. Overall we don't recommend this on every site, so use caution!

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

Responsive images

-

Images in Bootstrap 3 can be made responsive-friendly via the addition of the .img-responsive class. This applies max-width: 100%; and height: auto; to the image so that it scales nicely to the parent element.

+

Responsive images

+

Images in Bootstrap 3 can be made responsive-friendly via the addition of the .img-responsive class. This applies max-width: 100%; and height: auto; to the image so that it scales nicely to the parent element.

{% highlight html %} Responsive image {% endhighlight %} - -

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

-
    -
  • Set background-color: #fff; on the body
  • -
  • Use the @font-family-base, @font-size-base, and @line-height-base attributes as our typographic base
  • -
  • Set the global link color via @link-color and apply link underlines only on :hover
  • -
-

These styles can be found within scaffolding.less.

+ +

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

+
    +
  • Set background-color: #fff; on the body
  • +
  • Use the @font-family-base, @font-size-base, and @line-height-base attributes as our typographic base
  • +
  • Set the global link color via @link-color and apply link underlines only on :hover
  • +
+

These styles can be found within scaffolding.less.

-

Normalize

-

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

+

Normalize

+

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

-

Containers

-

Easily center a page's contents by wrapping its contents in a .container. Containers set width at various media query breakpoints to match our grid system.

-

Note that, due to padding and fixed widths, containers are not nestable by default.

+

Containers

+

Easily center a page's contents by wrapping its contents in a .container. Containers set width at various media query breakpoints to match our grid system.

+

Note that, due to padding and fixed widths, containers are not nestable by default.

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

Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.

+ +
+

Grid system

-

Introduction

-

Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap grid system works:

-
    -
  • Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding.
  • -
  • Use rows to create horizontal groups of columns.
  • -
  • Content should be placed within columns, and only columns may be immediate children of rows.
  • -
  • Predefined grid classes like .row and .col-xs-4 are available for quickly making grid layouts. Less mixins can also be used for more semantic layouts.
  • -
  • Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and last column via negative margin on .rows.
  • -
  • Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three .col-xs-4.
  • -
-

Look to the examples for applying these principles to your code.

+

Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.

-
-

Grids and full-width layouts

-

Folks looking to create fully fluid layouts (meaning your site stretches the entire width of the viewport) must wrap their grid content in a containing element with padding: 0 15px; to offset the margin: 0 -15px; used on .rows.

-
+

Introduction

+

Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap grid system works:

+
    +
  • Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding.
  • +
  • Use rows to create horizontal groups of columns.
  • +
  • Content should be placed within columns, and only columns may be immediate children of rows.
  • +
  • Predefined grid classes like .row and .col-xs-4 are available for quickly making grid layouts. Less mixins can also be used for more semantic layouts.
  • +
  • Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and last column via negative margin on .rows.
  • +
  • Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three .col-xs-4.
  • +
+

Look to the examples for applying these principles to your code.

+ +
+

Grids and full-width layouts

+

Folks looking to create fully fluid layouts (meaning your site stretches the entire width of the viewport) must wrap their grid content in a containing element with padding: 0 15px; to offset the margin: 0 -15px; used on .rows.

+
-

Media queries

-

We use the following media queries in our Less files to create the key breakpoints in our grid system.

+

Media queries

+

We use the following media queries in our Less files to create the key breakpoints in our grid system.

{% highlight css %} /* Extra small devices (phones, less than 768px) */ /* No media query since this is the default in Bootstrap */ @@ -104,7 +102,7 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e /* Large devices (large desktops, 1200px and up) */ @media (min-width: @screen-lg-min) { ... } {% endhighlight %} -

We occasionally expand on these media queries to include a max-width to limit CSS to a narrower set of devices.

+

We occasionally expand on these media queries to include a max-width to limit CSS to a narrower set of devices.

{% highlight css %} @media (max-width: @screen-xs-max) { ... } @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { ... } @@ -112,114 +110,114 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e @media (min-width: @screen-lg-min) { ... } {% endhighlight %} -

Grid options

-

See how aspects of the Bootstrap grid system work across multiple devices with a handy table.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Extra small devices - Phones (<768px) - - Small devices - Tablets (≥768px) - - Medium devices - Desktops (≥992px) - - Large devices - Desktops (≥1200px) -
Grid behaviorHorizontal at all timesCollapsed to start, horizontal above breakpoints
Container widthNone (auto)750px970px1170px
Class prefix.col-xs-.col-sm-.col-md-.col-lg-
# of columns12
Column widthAuto60px78px95px
Gutter width30px (15px on each side of a column)
NestableYes
OffsetsYes
Column orderingYes
-
-

Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, applying any .col-md- class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg- class is not present.

+

Grid options

+

See how aspects of the Bootstrap grid system work across multiple devices with a handy table.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Extra small devices + Phones (<768px) + + Small devices + Tablets (≥768px) + + Medium devices + Desktops (≥992px) + + Large devices + Desktops (≥1200px) +
Grid behaviorHorizontal at all timesCollapsed to start, horizontal above breakpoints
Container widthNone (auto)750px970px1170px
Class prefix.col-xs-.col-sm-.col-md-.col-lg-
# of columns12
Column widthAuto60px78px95px
Gutter width30px (15px on each side of a column)
NestableYes
OffsetsYes
Column orderingYes
+
+

Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, applying any .col-md- class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg- class is not present.

-

Example: Stacked-to-horizontal

-

Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any .row.

-
-
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
.col-md-1
-
-
-
.col-md-8
-
.col-md-4
-
-
-
.col-md-4
-
.col-md-4
-
.col-md-4
-
-
-
.col-md-6
-
.col-md-6
-
+

Example: Stacked-to-horizontal

+

Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any .row.

+
+
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
.col-md-1
+
+
+
.col-md-8
+
.col-md-4
+
+
+
.col-md-4
+
.col-md-4
+
.col-md-4
+
+
+
.col-md-6
+
.col-md-6
+
{% highlight html %}
.col-md-1
@@ -250,8 +248,8 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -

Example: Fluid container

-

Turn any fixed-width grid layout into a full-width layout by changing your outermost .container to .container-fluid.

+

Example: Fluid container

+

Turn any fixed-width grid layout into a full-width layout by changing your outermost .container to .container-fluid.

{% highlight html %}
@@ -260,23 +258,23 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -

Example: Mobile and desktop

-

Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding .col-xs-* .col-md-* to your columns. See the example below for a better idea of how it all works.

-
-
-
.col-xs-12 .col-md-8
-
.col-xs-6 .col-md-4
-
-
-
.col-xs-6 .col-md-4
-
.col-xs-6 .col-md-4
-
.col-xs-6 .col-md-4
-
-
-
.col-xs-6
-
.col-xs-6
-
+

Example: Mobile and desktop

+

Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding .col-xs-* .col-md-* to your columns. See the example below for a better idea of how it all works.

+
+
+
.col-xs-12 .col-md-8
+
.col-xs-6 .col-md-4
+
+
.col-xs-6 .col-md-4
+
.col-xs-6 .col-md-4
+
.col-xs-6 .col-md-4
+
+
+
.col-xs-6
+
.col-xs-6
+
+
{% highlight html %}
@@ -298,21 +296,21 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -

Example: Mobile, tablet, desktops

-

Build on the previous example by creating even more dynamic and powerful layouts with tablet .col-sm-* classes.

-
-
-
.col-xs-12 .col-sm-6 .col-md-8
-
.col-xs-6 .col-md-4
-
-
-
.col-xs-6 .col-sm-4
-
.col-xs-6 .col-sm-4
- -
-
.col-xs-6 .col-sm-4
-
+

Example: Mobile, tablet, desktops

+

Build on the previous example by creating even more dynamic and powerful layouts with tablet .col-sm-* classes.

+
+
+
.col-xs-12 .col-sm-6 .col-md-8
+
.col-xs-6 .col-md-4
+
+
+
.col-xs-6 .col-sm-4
+
.col-xs-6 .col-sm-4
+ +
+
.col-xs-6 .col-sm-4
+
{% highlight html %}
.col-xs-12 .col-sm-6 .col-md-8
@@ -327,24 +325,24 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -

Responsive column resets

-

With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a .clearfix and our responsive utility classes.

-
-
-
- .col-xs-6 .col-sm-3 -
- Resize your viewport or check it out on your phone for an example. -
-
.col-xs-6 .col-sm-3
+

Responsive column resets

+

With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a .clearfix and our responsive utility classes.

+
+
+
+ .col-xs-6 .col-sm-3 +
+ Resize your viewport or check it out on your phone for an example. +
+
.col-xs-6 .col-sm-3
- -
+ +
-
.col-xs-6 .col-sm-3
-
.col-xs-6 .col-sm-3
+
.col-xs-6 .col-sm-3
+
.col-xs-6 .col-sm-3
+
-
{% highlight html %}
.col-xs-6 .col-sm-3
@@ -357,7 +355,7 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
.col-xs-6 .col-sm-3
{% endhighlight %} -

In addition to column clearing at responsive breakpoints, you may need to reset offsets, pushes, or pulls. Those resets are available for medium and large grid tiers only, since they start only at the (second) small grid tier. See this in action in the grid example.

+

In addition to column clearing at responsive breakpoints, you may need to reset offsets, pushes, or pulls. Those resets are available for medium and large grid tiers only, since they start only at the (second) small grid tier. See this in action in the grid example.

{% highlight html %}
.col-sm-5 .col-md-6
@@ -371,21 +369,21 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e {% endhighlight %} -

Offsetting columns

-

Move columns to the right using .col-md-offset-* classes. These classes increase the left margin of a column by * columns. For example, .col-md-offset-4 moves .col-md-4 over four columns.

-
-
-
.col-md-4
-
.col-md-4 .col-md-offset-4
-
-
-
.col-md-3 .col-md-offset-3
-
.col-md-3 .col-md-offset-3
-
-
-
.col-md-6 .col-md-offset-3
-
+

Offsetting columns

+

Move columns to the right using .col-md-offset-* classes. These classes increase the left margin of a column by * columns. For example, .col-md-offset-4 moves .col-md-4 over four columns.

+
+
+
.col-md-4
+
.col-md-4 .col-md-offset-4
+
+
+
.col-md-3 .col-md-offset-3
+
.col-md-3 .col-md-offset-3
+
+
.col-md-6 .col-md-offset-3
+
+
{% highlight html %}
.col-md-4
@@ -401,21 +399,21 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e {% endhighlight %} -

Nesting columns

-

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

-
-
- Level 1: .col-md-9 -
-
- Level 2: .col-md-6 -
-
- Level 2: .col-md-6 -
+

Nesting columns

+

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

+
+
+ Level 1: .col-md-9 +
+
+ Level 2: .col-md-6 +
+
+ Level 2: .col-md-6
+
{% highlight html %}
@@ -432,12 +430,12 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -

Column ordering

-

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

-
-
.col-md-9 .col-md-push-3
-
.col-md-3 .col-md-pull-9
-
+

Column ordering

+

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

+
+
.col-md-9 .col-md-push-3
+
.col-md-3 .col-md-pull-9
+
{% highlight html %}
@@ -446,19 +444,19 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% 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.

+

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.

+

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 %} @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.

+

Mixins

+

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

{% highlight css %} // Creates a wrapper for a series of columns .make-row(@gutter: @grid-gutter-width) { @@ -593,8 +591,8 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e } {% 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.

+

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 %} .wrapper { .make-row(); @@ -613,52 +611,48 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
...
{% endhighlight %} - -
- - +
- -
- - -

Headings

-

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

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

h1. Bootstrap heading

Semibold 36px

h2. Bootstrap heading

Semibold 30px

h3. Bootstrap heading

Semibold 24px

h4. Bootstrap heading

Semibold 18px
h5. Bootstrap heading
Semibold 14px
h6. Bootstrap heading
Semibold 12px
-
+ +
+

Typography

+ + +

Headings

+

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

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

h1. Bootstrap heading

Semibold 36px

h2. Bootstrap heading

Semibold 30px

h3. Bootstrap heading

Semibold 24px

h4. Bootstrap heading

Semibold 18px
h5. Bootstrap heading
Semibold 14px
h6. Bootstrap heading
Semibold 12px
+
{% highlight html %}

h1. Bootstrap heading

h2. Bootstrap heading

@@ -668,31 +662,31 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
h6. Bootstrap heading
{% endhighlight %} -

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

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

h1. Bootstrap heading Secondary text

h2. Bootstrap heading Secondary text

h3. Bootstrap heading Secondary text

h4. Bootstrap heading Secondary text

h5. Bootstrap heading Secondary text
h6. Bootstrap heading Secondary text
-
+

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

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

h1. Bootstrap heading Secondary text

h2. Bootstrap heading Secondary text

h3. Bootstrap heading Secondary text

h4. Bootstrap heading Secondary text

h5. Bootstrap heading Secondary text
h6. Bootstrap heading Secondary text
+
{% highlight html %}

h1. Bootstrap heading Secondary text

h2. Bootstrap heading Secondary text

@@ -703,79 +697,79 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e {% endhighlight %} - -

Body copy

-

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

-
-

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

-

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.

-

Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.

-
+ +

Body copy

+

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

+
+

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

+

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.

+

Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.

+
{% highlight html %}

...

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

-
+ +

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

...

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

+ +

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.

+ +

Emphasis

+

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

-

Small text

-

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

-

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

-
-

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

-
+

Small text

+

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

+

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

+
+

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

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

-
+

Bold

+

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

+
+

The following snippet of text is rendered as bold text.

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

Italics

-

For emphasizing a snippet of text with italics.

-
-

The following snippet of text is rendered as italicized text.

-
+

Italics

+

For emphasizing a snippet of text with italics.

+
+

The following snippet of text is rendered as italicized text.

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

Alternate elements

-

Feel free to use <b> and <i> in HTML5. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.

-
+
+

Alternate elements

+

Feel free to use <b> and <i> in HTML5. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.

+
-

Alignment classes

-

Easily realign text to components with text alignment classes.

-
-

Left aligned text.

-

Center aligned text.

-

Right aligned text.

-

Justified text.

-
+

Alignment classes

+

Easily realign text to components with text alignment classes.

+
+

Left aligned text.

+

Center aligned text.

+

Right aligned text.

+

Justified text.

+
{% highlight html %}

Left aligned text.

Center aligned text.

@@ -784,44 +778,44 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e {% 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.

+ +

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.

-
+

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 %} attr {% endhighlight %} -

Initialism

-

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

-
-

HTML is the best thing since sliced bread.

-
+

Initialism

+

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

+
+

HTML is the best thing since sliced bread.

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

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 %}
Twitter, Inc.
@@ -837,34 +831,34 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e {% endhighlight %} - -

Blockquotes

-

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

+ +

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.

-
-
+

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

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

+

Blockquote options

+

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

-

Naming a source

-

Add a <footer> 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
-
-
+

Naming a source

+

Add a <footer> 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 %}

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

@@ -872,14 +866,14 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -

Alternate displays

-

Add .blockquote-reverse for blockquote with right-aligned content.

-
-
-

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

-
Someone famous in Source Title
-
-
+

Alternate displays

+

Add .blockquote-reverse for blockquote with right-aligned content.

+
+
+

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

+
Someone famous in Source Title
+
+
{% highlight html %}
... @@ -887,111 +881,111 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e {% 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
  • -
-
+ +

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 %}
  • ...
{% 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. -
-
+

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 %}
  1. ...
{% 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
  • -
-
+

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

Inline

-

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

-
-
    -
  • Lorem ipsum
  • -
  • Phasellus iaculis
  • -
  • Nulla volutpat
  • -
-
+

Inline

+

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

+
+
    +
  • Lorem ipsum
  • +
  • Phasellus iaculis
  • +
  • Nulla volutpat
  • +
+
{% highlight html %}
  • ...
{% 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.
-
-
+

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 %}
...
@@ -999,21 +993,21 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -

Horizontal description

-

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

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

Horizontal description

+

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

+
+
+
Description lists
+
A description list is perfect for defining terms.
+
Euismod
+
Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
+
Donec id elit non mi porta gravida at eget metus.
+
Malesuada porta
+
Etiam porta sem malesuada magna mollis euismod.
+
Felis euismod semper eget lacinia
+
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
+
+
{% highlight html %}
...
@@ -1021,22 +1015,21 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
{% endhighlight %} -
-

Auto-truncating

-

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

-
+
+

Auto-truncating

+

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

+
- -
- -

Inline

-

Wrap inline snippets of code with <code>.

+ +
+

Code

+ +

Inline

+

Wrap inline snippets of code with <code>.

For example, <section> should be wrapped as inline.
@@ -1044,8 +1037,8 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e For example, <section> should be wrapped as inline. {% endhighlight %} -

User input

-

Use the <kbd> to indicate input that is typically entered via keyboard.

+

User input

+

Use the <kbd> to indicate input that is typically entered via keyboard.

To switch directories, type cd followed the name of the directory.
@@ -1053,8 +1046,8 @@ For example, <section> should be wrapped as inline. To switch directories, type cd followed the name of the directory. {% endhighlight %} -

Basic block

-

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

+

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>
@@ -1062,52 +1055,50 @@ For example, <section> should be wrapped as inline.
<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.

-
+

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

+
- -
- - -

Basic example

-

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

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
-
+ +
+

Tables

+ +

Basic example

+

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
+
{% highlight html %} ... @@ -1115,44 +1106,44 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Striped rows

-

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

-
-

Cross-browser compatibility

-

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

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
-
+

Striped rows

+

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

+
+

Cross-browser compatibility

+

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

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
+
{% highlight html %} ... @@ -1160,44 +1151,44 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Bordered table

-

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

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#First NameLast NameUsername
1MarkOtto@mdo
MarkOtto@TwBootstrap
2JacobThornton@fat
3Larry the Bird@twitter
-
+

Bordered table

+

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameUsername
1MarkOtto@mdo
MarkOtto@TwBootstrap
2JacobThornton@fat
3Larry the Bird@twitter
+
{% highlight html %} ... @@ -1205,39 +1196,39 @@ For example, <section> should be wrapped as inline. {% 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
-
+

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 %} ... @@ -1245,39 +1236,39 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Condensed table

-

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

Condensed table

+

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 %} ... @@ -1285,234 +1276,234 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Contextual classes

-

Use contextual classes to color table rows or individual cells.

+

Contextual classes

+

Use contextual classes to color table rows or individual cells.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassDescription
+ .active + Applies the hover color to a particular row or cell
+ .success + Indicates a successful or positive action
+ .info + Indicates a neutral informative change or action
+ .warning + Indicates a warning that might need attention
+ .danger + Indicates a dangerous or potentially negative action
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Column headingColumn headingColumn heading
1Column contentColumn contentColumn content
2Column contentColumn contentColumn content
3Column contentColumn contentColumn content
4Column contentColumn contentColumn content
5Column contentColumn contentColumn content
6Column contentColumn contentColumn content
7Column contentColumn contentColumn content
8Column contentColumn contentColumn content
9Column contentColumn contentColumn content
+
+{% highlight html %} + +... +... +... +... +... + + + + ... + ... + ... + ... + ... + +{% endhighlight %} + + +

Responsive tables

+

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

+
- - - - - +
- - + + + + + + + - - - - - - - - - - + + + + + + + - - + + + + + + + - - + + + + + + +
ClassDescription#Table headingTable headingTable headingTable headingTable headingTable heading
- .active - Applies the hover color to a particular row or cell
- .success - Indicates a successful or positive action
- .info - Indicates a neutral informative change or action1Table cellTable cellTable cellTable cellTable cellTable cell
- .warning - Indicates a warning that might need attention2Table cellTable cellTable cellTable cellTable cellTable cell
- .danger - Indicates a dangerous or potentially negative action3Table cellTable cellTable cellTable cellTable cellTable cell
-
-
- + + +
+
- - - + + + + + + - + - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + +
#Column headingColumn headingColumn headingTable headingTable headingTable headingTable headingTable headingTable heading
1Column contentColumn contentColumn contentTable cellTable cellTable cellTable cellTable cellTable cell
2Column contentColumn contentColumn content
3Column contentColumn contentColumn content
4Column contentColumn contentColumn content
5Column contentColumn contentColumn contentTable cellTable cellTable cellTable cellTable cellTable cell
6Column contentColumn contentColumn content
7Column contentColumn contentColumn content
8Column contentColumn contentColumn content
9Column contentColumn contentColumn content3Table cellTable cellTable cellTable cellTable cellTable cell
-
-{% highlight html %} - -... -... -... -... -... - - - - ... - ... - ... - ... - ... - -{% endhighlight %} - - -

Responsive tables

-

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

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#Table headingTable headingTable headingTable headingTable headingTable heading
1Table cellTable cellTable cellTable cellTable cellTable cell
2Table cellTable cellTable cellTable cellTable cellTable cell
3Table cellTable cellTable cellTable cellTable cellTable cell
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#Table headingTable headingTable headingTable headingTable headingTable heading
1Table cellTable cellTable cellTable cellTable cellTable cell
2Table cellTable cellTable cellTable cellTable cellTable cell
3Table cellTable cellTable cellTable cellTable cellTable cell
-
-
+
+
{% highlight html %}
@@ -1520,43 +1511,40 @@ For example, <section> should be wrapped as inline.
{% endhighlight %} - -
+
- -
- + +
+

Forms

-

Basic example

-

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

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

Example block-level help text here.

-
-
- -
- -
-
+

Basic example

+

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

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

Example block-level help text here.

+
+
+ +
+ +
+
{% highlight html %}
@@ -1582,34 +1570,34 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Inline form

-

Add .form-inline to your <form> for left-aligned and inline-block controls. This only applies to forms within viewports that are at least 768px wide.

-
-

Requires custom widths

-

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

-
-
-

Always add labels

-

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

-
-
- -
- - -
-
- - -
-
- -
- - -
+

Inline form

+

Add .form-inline to your <form> for left-aligned and inline-block controls. This only applies to forms within viewports that are at least 768px wide.

+
+

Requires custom widths

+

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

+
+
+

Always add labels

+

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

+
+
+
+
+ + +
+
+ + +
+
+ +
+ +
+
{% highlight html %}
@@ -1630,38 +1618,38 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Horizontal form

-

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

-
- -
- -
- -
+

Horizontal form

+

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

+
+ +
+ +
+
-
- -
- -
+
+
+ +
+
-
-
-
- -
+
+
+
+
+
-
-
- -
+
+
+
+
- -
+
+ +
{% highlight html %}
@@ -1694,65 +1682,65 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Supported controls

-

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

+

Supported controls

+

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

-

Inputs

-

Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.

-
-

Type declaration required

-

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

-
-
- - - -
+

Inputs

+

Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.

+
+

Type declaration required

+

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

+
+
+
+ +
+
{% highlight html %} {% endhighlight %} -
-

Input groups

-

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

-
+
+

Input groups

+

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

+
-

Textarea

-

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

-
-
- -
-
+

Textarea

+

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

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

-
-
-
- -
-
-
- -
-
- -
-
-
+

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 %}
{% endhighlight %} -

Inline checkboxes

-

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

-
-
- - - -
-
+

Inline checkboxes

+

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

+
+
+ + + +
+
{% highlight html %} {% endhighlight %} -

Selects

-

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

-
-
- -
- -
-
+

Selects

+

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

+
+
+ +
+ +
+
{% highlight html %} -
+
+
+ +
+
- -
+
+ +
{% highlight html %}
@@ -1877,66 +1865,65 @@ For example, <section> should be wrapped as inline. {% endhighlight %} - -

Input focus

-

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

-
-
- -
-
-
-

Demo :focus state

-

The above example input uses custom styles in our documentation to demonstrate the :focus state on a .form-control.

-
+

Input focus

+

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

+
+
+ +
+
+
+

Demo :focus state

+

The above example input uses custom styles in our documentation to demonstrate the :focus state on a .form-control.

+
-

Disabled inputs

-

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

-
-
- -
-
+

Disabled inputs

+

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

+
+
+ +
+
{% highlight html %} {% endhighlight %} -

Disabled fieldsets

-

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

+

Disabled fieldsets

+

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

-
-

Link functionality of <a> not impacted

-

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

-
+
+

Link functionality of <a> not impacted

+

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

+
-
-

Cross-browser compatibility

-

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

-
+
+

Cross-browser compatibility

+

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

+
-
-
-
-
- - -
-
- - -
-
- -
- -
-
-
+
+
+
+
+ + +
+
+ + +
+
+ +
+ +
+
+
{% highlight html %}
@@ -1961,25 +1948,25 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Validation states

-

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

+

Validation states

+

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

-
- -
- - -
-
- - -
-
- - -
- -
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
{% highlight html %}
@@ -1995,27 +1982,27 @@ For example, <section> should be wrapped as inline.
{% endhighlight %} -

With optional icons

-

You can also add optional feedback icons with the addition of an extra class and the right icon.

-
-
-
- - - -
-
- - - -
-
- - - -
-
-
+

With optional icons

+

You can also add optional feedback icons with the addition of an extra class and the right icon.

+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
{% highlight html %}
@@ -2034,18 +2021,18 @@ For example, <section> should be wrapped as inline.
{% endhighlight %} -

Optional icons also work on horizontal and inline forms.

-
-
-
- -
- - -
+

Optional icons also work on horizontal and inline forms.

+
+ +
+ +
+ +
- -
+
+ +
{% highlight html %}
@@ -2058,15 +2045,15 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -
-
-
- - - -
-
-
+
+
+
+ + + +
+
+
{% highlight html %}
@@ -2078,31 +2065,30 @@ For example, <section> should be wrapped as inline. {% endhighlight %} +

Control sizing

+

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

-

Control sizing

-

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

- -

Height sizing

-

Create taller or shorter form controls that match button sizes.

-
- -
- - - +

Height sizing

+

Create taller or shorter form controls that match button sizes.

+
+ +
+ + + - - - -
- -
+ + + +
+ +
{% highlight html %} @@ -2113,23 +2099,23 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Column sizing

-

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

-
-
-
-
- -
-
- -
-
- -
+

Column sizing

+

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

+
+ +
+
+ +
+
+
- -
+
+ +
+
+ +
{% highlight html %}
@@ -2144,40 +2130,37 @@ For example, <section> should be wrapped as inline.
{% endhighlight %} -

Help text

-

Block level help text for form controls.

-
-
- - A block of help text that breaks onto a new line and may extend beyond one line. -
-
+

Help text

+

Block level help text for form controls.

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

Buttons

-

Options

-

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

-
- - - - - - - -
+

Options

+

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

+
+ + + + + + + +
{% highlight html %} @@ -2201,26 +2184,26 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Sizes

-

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

-
-

- - -

-

- - -

-

- - -

-

- - -

-
+

Sizes

+

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

+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
{% highlight html %}

@@ -2240,95 +2223,95 @@ For example, <section> should be wrapped as inline.

{% endhighlight %} -

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

-
-
- - -
+

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

+
+
+ +
+
{% highlight html %} {% endhighlight %} -

Active state

-

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

+

Active state

+

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

-

Button element

-

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

-

- - -

+

Button element

+

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

+

+ + +

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

Anchor element

-

Add the .active class to <a> buttons.

-

- Primary link - Link -

+

Anchor element

+

Add the .active class to <a> buttons.

+

+ Primary link + Link +

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

Disabled state

-

Make buttons look unclickable by fading them back 50%.

+

Disabled state

+

Make buttons look unclickable by fading them back 50%.

-

Button element

-

Add the disabled attribute to <button> buttons.

-

- - -

+

Button element

+

Add the disabled attribute to <button> buttons.

+

+ + +

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

Cross-browser compatibility

-

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

-
+
+

Cross-browser compatibility

+

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

+
-

Anchor element

-

Add the .disabled class to <a> buttons.

-

- Primary link - Link -

+

Anchor element

+

Add the .disabled class to <a> buttons.

+

+ Primary link + Link +

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

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

-
-

Link functionality not impacted

-

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

-
-
-

Context-specific usage

-

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

-
+

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

+
+

Link functionality not impacted

+

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

+
+
+

Context-specific usage

+

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

+
-

Button tags

-

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

-
- Link - - - -
+

Button tags

+

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

+
+ Link + + + +
{% highlight html %} Link @@ -2336,64 +2319,59 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -
-

Cross-browser rendering

-

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

-

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

-
- +
+

Cross-browser rendering

+

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

+

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

+
- -
- + +
+

Images

-

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

-
-

Cross-browser compatibility

-

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

-
-
- A generic square placeholder image with rounded corners - A generic square placeholder image where only the portion within the circle circumscribed about said square is visible - A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera -
+

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

+
+

Cross-browser compatibility

+

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

+
+
+ A generic square placeholder image with rounded corners + A generic square placeholder image where only the portion within the circle circumscribed about said square is visible + A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera +
{% highlight html %} ... ... ... {% endhighlight %} -
-

Responsive images

-

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

-
- +
+

Responsive images

+

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

+
- -
- -

Contextual colors

-

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

-
-

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

-

Nullam id dolor id nibh ultricies vehicula ut id elit.

-

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

-

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

-

Etiam porta sem malesuada magna mollis euismod.

-

Donec ullamcorper nulla non metus auctor fringilla.

-
+ +
+

Helper classes

+ +

Contextual colors

+

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

+
+

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

+

Nullam id dolor id nibh ultricies vehicula ut id elit.

+

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

+

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

+

Etiam porta sem malesuada magna mollis euismod.

+

Donec ullamcorper nulla non metus auctor fringilla.

+
{% highlight html %}

...

...

@@ -2402,20 +2380,20 @@ For example, <section> should be wrapped as inline.

...

...

{% endhighlight %} -
-

Dealing with specificity

-

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

-
+
+

Dealing with specificity

+

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

+
-

Contextual backgrounds

-

Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes.

-
-

Nullam id dolor id nibh ultricies vehicula ut id elit.

-

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

-

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

-

Etiam porta sem malesuada magna mollis euismod.

-

Donec ullamcorper nulla non metus auctor fringilla.

-
+

Contextual backgrounds

+

Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes.

+
+

Nullam id dolor id nibh ultricies vehicula ut id elit.

+

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

+

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

+

Etiam porta sem malesuada magna mollis euismod.

+

Donec ullamcorper nulla non metus auctor fringilla.

+
{% highlight html %}

...

...

@@ -2425,28 +2403,28 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Close icon

-

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

-
-

-
+

Close icon

+

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

+
+

+
{% highlight html %} {% endhighlight %} -

Carets

-

Use carets to indicate dropdown functionality and direction. Note that the default caret will reverse automatically in dropup menus.

-
- -
+

Carets

+

Use carets to indicate dropdown functionality and direction. Note that the default caret will reverse automatically in dropup menus.

+
+ +
{% highlight html %} {% endhighlight %} -

Quick floats

-

Float an element to the left or right with a class. !important is included to avoid specificity issues. Classes can also be used as mixins.

+

Quick floats

+

Float an element to the left or right with a class. !important is included to avoid specificity issues. Classes can also be used as mixins.

{% highlight html %}
...
...
@@ -2469,14 +2447,14 @@ For example, <section> should be wrapped as inline. } {% endhighlight %} -
-

Not for use in navbars

-

To align components in navbars with utility classes, use .navbar-left or .navbar-right instead. See the navbar docs for details.

-
+
+

Not for use in navbars

+

To align components in navbars with utility classes, use .navbar-left or .navbar-right instead. See the navbar docs for details.

+
-

Center content blocks

-

Set an element to display: block and center via margin. Available as a mixin and class.

+

Center content blocks

+

Set an element to display: block and center via margin. Available as a mixin and class.

{% highlight html %}
...
{% endhighlight %} @@ -2495,9 +2473,8 @@ For example, <section> should be wrapped as inline. {% endhighlight %} - -

Clearfix

-

Clear the float on any element with the .clearfix class. Utilizes the micro clearfix as popularized by Nicolas Gallagher. Can also be used as a mixin.

+

Clearfix

+

Clear the float on any element with the .clearfix class. Utilizes the micro clearfix as popularized by Nicolas Gallagher. Can also be used as a mixin.

{% highlight html %}
...
@@ -2522,10 +2499,10 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Showing and hiding content

-

Force an element to be shown or hidden (including for screen readers) with the use of .show and .hidden classes. These classes use !important to avoid specificity conflicts, just like the quick floats. They are only available for block level toggling. They can also be used as mixins.

-

.hide is available, but it does not always affect screen readers and is deprecated as of v3.0.1. Use .hidden or .sr-only instead.

-

Furthermore, .invisible can be used to toggle only the visibility of an element, meaning its display is not modified and the element can still affect the flow of the document.

+

Showing and hiding content

+

Force an element to be shown or hidden (including for screen readers) with the use of .show and .hidden classes. These classes use !important to avoid specificity conflicts, just like the quick floats. They are only available for block level toggling. They can also be used as mixins.

+

.hide is available, but it does not always affect screen readers and is deprecated as of v3.0.1. Use .hidden or .sr-only instead.

+

Furthermore, .invisible can be used to toggle only the visibility of an element, meaning its display is not modified and the element can still affect the flow of the document.

{% highlight html %}
...
@@ -2553,8 +2530,8 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Screen reader content

-

Hide an element to all devices except screen readers with .sr-only. Necessary for following accessibility best practices. Can also be used as a mixin.

+

Screen reader content

+

Hide an element to all devices except screen readers with .sr-only. Necessary for following accessibility best practices. Can also be used as a mixin.

{% highlight html %} Skip to main content {% endhighlight %} @@ -2566,8 +2543,8 @@ For example, <section> should be wrapped as inline. {% endhighlight %} -

Image replacement

-

Utilize the .text-hide class or mixin to help replace an element's text content with a background image.

+

Image replacement

+

Utilize the .text-hide class or mixin to help replace an element's text content with a background image.

{% highlight html %}

Custom heading

{% endhighlight %} @@ -2577,272 +2554,269 @@ For example, <section> should be wrapped as inline. .text-hide(); } {% 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.

-

Try to use these 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 are currently only available for block and table toggling. Use with inline and table elements is currently not supported.

-

Available classes

-

Use a single or combination of the available classes for toggling content across viewport breakpoints.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Extra small devices - Phones (<768px) - - Small devices - Tablets (≥768px) - - Medium devices - Desktops (≥992px) - - Large devices - Desktops (≥1200px) -
.visible-xsVisible
.visible-smVisible
.visible-mdVisible
.visible-lgVisible
.hidden-xsVisibleVisibleVisible
.hidden-smVisibleVisibleVisible
.hidden-mdVisibleVisibleVisible
.hidden-lgVisibleVisibleVisible
-
+ +
+

Responsive utilities

+ +

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.

+

Try to use these 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 are currently only available for block and table toggling. Use with inline and table elements is currently not supported.

+ + +

Available classes

+

Use a single or combination of the available classes for toggling content across viewport breakpoints.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Extra small devices + Phones (<768px) + + Small devices + Tablets (≥768px) + + Medium devices + Desktops (≥992px) + + Large devices + Desktops (≥1200px) +
.visible-xsVisible
.visible-smVisible
.visible-mdVisible
.visible-lgVisible
.hidden-xsVisibleVisibleVisible
.hidden-smVisibleVisibleVisible
.hidden-mdVisibleVisibleVisible
.hidden-lgVisibleVisibleVisible
+
-

Print classes

-

Similar to the regular responsive classes, use these for toggling content for print.

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

Print classes

+

Similar to the regular responsive classes, use these for toggling content for print.

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

Test cases

-

Resize your browser or load on different devices to test the responsive utility classes.

+

Test cases

+

Resize your browser or load on different devices to test the responsive utility classes.

-

Visible on...

-

Green checkmarks indicate the element is visible in your current viewport.

-
-
- - ✔ Visible on x-small -
-
- - ✔ Visible on small -
-
-
- Medium - ✔ Visible on medium -
-
- - ✔ Visible on large -
+

Visible on...

+

Green checkmarks indicate the element is visible in your current viewport.

+
+
+ + ✔ Visible on x-small
-
-
- - ✔ Visible on x-small and small -
-
- - ✔ Visible on medium and large -
-
-
- - ✔ Visible on x-small and medium -
-
- - ✔ Visible on small and large -
-
-
- - ✔ Visible on x-small and large -
-
- - ✔ Visible on small and medium -
+
+ + ✔ Visible on small
- -

Hidden on...

-

Here, green checkmarks also indicate the element is hidden in your current viewport.

-
-
- - ✔ Hidden on x-small -
-
- - ✔ Hidden on small -
-
-
- Medium - ✔ Hidden on medium -
-
- - ✔ Hidden on large -
+
+
+ Medium + ✔ Visible on medium
-
-
- - ✔ Hidden on x-small and small -
-
- - ✔ Hidden on medium and large -
-
-
- - ✔ Hidden on x-small and medium -
-
- - ✔ Hidden on small and large -
-
-
- - ✔ Hidden on x-small and large -
-
- - ✔ Hidden on small and medium -
+
+ + ✔ Visible on large +
+
+
+
+ + ✔ Visible on x-small and small +
+
+ + ✔ Visible on medium and large +
+
+
+ + ✔ Visible on x-small and medium +
+
+ + ✔ Visible on small and large +
+
+
+ + ✔ Visible on x-small and large
+
+ + ✔ Visible on small and medium +
+
+

Hidden on...

+

Here, green checkmarks also indicate the element is hidden in your current viewport.

+
+
+ + ✔ Hidden on x-small +
+
+ + ✔ Hidden on small +
+
+
+ Medium + ✔ Hidden on medium +
+
+ + ✔ Hidden on large +
+
+
+
+ + ✔ Hidden on x-small and small +
+
+ + ✔ Hidden on medium and large +
+
+
+ + ✔ Hidden on x-small and medium +
+
+ + ✔ Hidden on small and large +
+
+
+ + ✔ Hidden on x-small and large +
+
+ + ✔ Hidden on small and medium +
+
- -
- -

Bootstrap's CSS is built on Less, a preprocessor with additional functionality like variables, mixins, and functions for compiling CSS. Those looking to use the source Less files instead of our compiled CSS files can make use of the numerous variables and mixins we use throughout the framework.

+ +
+

Using Less

-

Grid variables and mixins are covered within the Grid system section.

+

Bootstrap's CSS is built on Less, a preprocessor with additional functionality like variables, mixins, and functions for compiling CSS. Those looking to use the source Less files instead of our compiled CSS files can make use of the numerous variables and mixins we use throughout the framework.

+

Grid variables and mixins are covered within the Grid system section.

-

Compiling Bootstrap

-

Bootstrap can be used in at least two ways: with the compiled CSS or with the source LESS files. To compile the LESS files, visit the README for how to setup your development environment to run the necessary commands.

-

Third party compilation tools may work with Bootstrap, but they are not supported by our core team.

-

Variables

-

Variables are used throughout the entire project as a way to centralize and share commonly used values like colors, spacing, or font stacks. For a complete breakdown, please see the Customizer.

+

Compiling Bootstrap

+

Bootstrap can be used in at least two ways: with the compiled CSS or with the source LESS files. To compile the LESS files, visit the README for how to setup your development environment to run the necessary commands.

+

Third party compilation tools may work with Bootstrap, but they are not supported by our core team.

-

Colors

-

Easily make use of two color schemes: grayscale and semantic. Grayscale colors provide quick access to commonly used shades of black while semantic include various colors assigned to meaningful contextual values.

-
-
-
-
-
-
-
-
+

Variables

+

Variables are used throughout the entire project as a way to centralize and share commonly used values like colors, spacing, or font stacks. For a complete breakdown, please see the Customizer.

+ +

Colors

+

Easily make use of two color schemes: grayscale and semantic. Grayscale colors provide quick access to commonly used shades of black while semantic include various colors assigned to meaningful contextual values.

+
+
+
+
+
+
+
+
{% highlight css %} @gray-darker: lighten(#000, 13.5%); // #222 @gray-dark: lighten(#000, 20%); // #333 @@ -2851,15 +2825,15 @@ For example, <section> should be wrapped as inline. @gray-lighter: lighten(#000, 93.5%); // #eee {% endhighlight %} -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
{% highlight css %} @brand-primary: #428bca; @brand-success: #5cb85c; @@ -2868,7 +2842,7 @@ For example, <section> should be wrapped as inline. @brand-danger: #d9534f; {% endhighlight %} -

Use any of these color variables as they are or reassign them to more meaningful variables for your project.

+

Use any of these color variables as they are or reassign them to more meaningful variables for your project.

{% highlight css %} // Use as-is .masthead { @@ -2882,16 +2856,16 @@ For example, <section> should be wrapped as inline. } {% endhighlight %} -

Scaffolding

-

A handful of variables for quickly customizing key elements of your site's skeleton.

+

Scaffolding

+

A handful of variables for quickly customizing key elements of your site's skeleton.

{% highlight css %} // Scaffolding @body-bg: #fff; @text-color: @black-50; {% endhighlight %} - -

Easily style your links with the right color with only one value.

+ +

Easily style your links with the right color with only one value.

{% highlight css %} // Variables @link-color: @brand-primary; @@ -2908,10 +2882,10 @@ a { } } {% endhighlight %} -

Note that the @link-color-hover uses a function, another awesome tool from Less, to automagically create the right hover color. You can use darken, lighten, saturate, and desaturate.

+

Note that the @link-color-hover uses a function, another awesome tool from Less, to automagically create the right hover color. You can use darken, lighten, saturate, and desaturate.

-

Typography

-

Easily set your type face, text size, leading, and more with a few quick variables. Bootstrap makes use of these as well to provide easy typographic mixins.

+

Typography

+

Easily set your type face, text size, leading, and more with a few quick variables. Bootstrap makes use of these as well to provide easy typographic mixins.

{% highlight css %} @font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif; @font-family-serif: Georgia, "Times New Roman", Times, serif; @@ -2938,15 +2912,15 @@ a { @headings-color: inherit; {% endhighlight %} -

Icons

-

Two quick variables for customizing the location and filename of your icons.

+

Icons

+

Two quick variables for customizing the location and filename of your icons.

{% highlight css %} @icon-font-path: "../fonts/"; @icon-font-name: "glyphicons-halflings-regular"; {% endhighlight %} -

Components

-

Components throughout Bootstrap make use of some default variables for setting common values. Here are the most commonly used.

+

Components

+

Components throughout Bootstrap make use of some default variables for setting common values. Here are the most commonly used.

{% highlight css %} @padding-base-vertical: 6px; @padding-base-horizontal: 12px; @@ -2975,12 +2949,12 @@ a { {% endhighlight %} -

Vendor mixins

-

Vendor mixins are mixins to help support multiple browsers by including all relevant vendor prefixs in your compiled CSS.

+

Vendor mixins

+

Vendor mixins are mixins to help support multiple browsers by including all relevant vendor prefixs in your compiled CSS.

-

Box-sizing

-

Reset your components' box model with a single mixin. For context, see this helpful article from Mozilla.

+

Box-sizing

+

Reset your components' box model with a single mixin. For context, see this helpful article from Mozilla.

{% highlight css %} .box-sizing(@box-model) { -webkit-box-sizing: @box-model; // Safari <= 5 @@ -2989,8 +2963,8 @@ a { } {% endhighlight %} -

Rounded corners

-

Today all modern browsers support the non-prefixed border-radius property. As such, there is no .border-radius() mixin, but Bootstrap does include shortcuts for quickly rounding two corners on a particular side of an object.

+

Rounded corners

+

Today all modern browsers support the non-prefixed border-radius property. As such, there is no .border-radius() mixin, but Bootstrap does include shortcuts for quickly rounding two corners on a particular side of an object.

{% highlight css %} .border-top-radius(@radius) { border-top-right-radius: @radius; @@ -3010,9 +2984,9 @@ a { } {% endhighlight %} -

Box (Drop) shadows

-

If your target audience is using the latest and greatest browsers and devices, be sure to just use the box-shadow property on its own. If you need support for older Android (pre-v4) and iOS devices (pre-iOS 5), use the mixin to pick up the required -webkit prefix.

-

Be sure to use rgba() colors in your box shadows so they blend as seamlessly as possible with backgrounds.

+

Box (Drop) shadows

+

If your target audience is using the latest and greatest browsers and devices, be sure to just use the box-shadow property on its own. If you need support for older Android (pre-v4) and iOS devices (pre-iOS 5), use the mixin to pick up the required -webkit prefix.

+

Be sure to use rgba() colors in your box shadows so they blend as seamlessly as possible with backgrounds.

{% highlight css %} .box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) { -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1 @@ -3020,8 +2994,8 @@ a { } {% endhighlight %} -

Transitions

-

Three mixins for flexibility. Set all transition information with one, or specify a separate delay and duration as needed.

+

Transitions

+

Three mixins for flexibility. Set all transition information with one, or specify a separate delay and duration as needed.

{% highlight css %} .transition(@transition) { -webkit-transition: @transition; @@ -3047,8 +3021,8 @@ a { } {% endhighlight %} -

Transformations

-

Rorate, scale, translate (move), or skew any object.

+

Transformations

+

Rorate, scale, translate (move), or skew any object.

{% highlight css %} .rotate(@degrees) { -webkit-transform: rotate(@degrees); @@ -3103,8 +3077,8 @@ a { } {% endhighlight %} -

Animations

-

A single mixin for using all CSS3's animation properties in one declarations and other mixins for individual properties.

+

Animations

+

A single mixin for using all CSS3's animation properties in one declarations and other mixins for individual properties.

{% highlight css %} .animation(@animation) { -webkit-animation: @animation; @@ -3136,8 +3110,8 @@ a { } {% endhighlight %} -

Opacity

-

Set the opacity for all browsers and provide a filter fallback for IE8.

+

Opacity

+

Set the opacity for all browsers and provide a filter fallback for IE8.

{% highlight css %} .opacity(@opacity) { opacity: @opacity; @@ -3147,8 +3121,8 @@ a { } {% endhighlight %} -

Placeholder text

-

Provide context for form controls within each field.

+

Placeholder text

+

Provide context for form controls within each field.

{% highlight css %} .placeholder(@color: @input-color-placeholder) { &:-moz-placeholder { color: @color; } // Firefox 4-18 @@ -3158,8 +3132,8 @@ a { } {% endhighlight %} -

Columns

-

Generate columns via CSS within a single element.

+

Columns

+

Generate columns via CSS within a single element.

{% highlight css %} .content-columns(@width; @count; @gap) { -webkit-column-width: @width; @@ -3174,34 +3148,34 @@ a { } {% endhighlight %} -

Gradients

-

Easily turn any two colors into a background gradient. Get more advanced and set a direction, use three colors, or use a radial gradient. With a single mixin you get all the prefixed syntaxes you'll need.

+

Gradients

+

Easily turn any two colors into a background gradient. Get more advanced and set a direction, use three colors, or use a radial gradient. With a single mixin you get all the prefixed syntaxes you'll need.

{% highlight css %} #gradient > .vertical(#333; #000); #gradient > .horizontal(#333; #000); #gradient > .radial(#333; #000); {% endhighlight %} -

You can also specify the angle of a standard two-color, linear gradient:

+

You can also specify the angle of a standard two-color, linear gradient:

{% highlight css %} #gradient > .directional(#333; #000; 45deg); {% endhighlight %} -

If you need a barber-stripe style gradient, that's easy, too. Just specify a single color and we'll overlay a translucent white stripe.

+

If you need a barber-stripe style gradient, that's easy, too. Just specify a single color and we'll overlay a translucent white stripe.

{% highlight css %} #gradient > .striped(#333; #000; 45deg); {% endhighlight %} -

Up the ante and use three colors instead. Set the first color, the second color, the second color's color stop (a decimal value like 0.25), and the third color with these mixins:

+

Up the ante and use three colors instead. Set the first color, the second color, the second color's color stop (a decimal value like 0.25), and the third color with these mixins:

{% highlight css %} #gradient > .vertical-three-colors(#777; #333; .25; #000); #gradient > .horizontal-three-colors(#777; #333; .25; #000); {% endhighlight %} -

Heads up! Should you ever need to remove a gradient, be sure to remove any IE-specific filter you may have added. You can do that by using .reset-filter() mixin alignside background-image: none;.

+

Heads up! Should you ever need to remove a gradient, be sure to remove any IE-specific filter you may have added. You can do that by using .reset-filter() mixin alignside background-image: none;.

-

Utility mixins

-

Utility mixins are mixins that combine otherwise unrelated CSS properties to achieve a specific goal or task.

+

Utility mixins

+

Utility mixins are mixins that combine otherwise unrelated CSS properties to achieve a specific goal or task.

-

Clearfix

-

Forget adding class="clearfix" to any element and instead add the .clearfix() mixin where appropriate. Uses the micro clearfix from Nicolas Gallager.

+

Clearfix

+

Forget adding class="clearfix" to any element and instead add the .clearfix() mixin where appropriate. Uses the micro clearfix from Nicolas Gallager.

{% highlight css %} // Mixin .clearfix() { @@ -3221,8 +3195,8 @@ a { } {% endhighlight %} -

Horizontal centering

-

Quickly center any element within its parent. Requires width or max-width to be set.

+

Horizontal centering

+

Quickly center any element within its parent. Requires width or max-width to be set.

{% highlight css %} // Mixin .center-block() { @@ -3238,8 +3212,8 @@ a { } {% endhighlight %} -

Sizing helpers

-

Specify the dimensions of an object more easily.

+

Sizing helpers

+

Specify the dimensions of an object more easily.

{% highlight css %} // Mixins .size(@width; @height) { @@ -3255,8 +3229,8 @@ a { .avatar { .square(48px); } {% endhighlight %} -

Resizable textareas

-

Easily configure the resize options for any textarea, or any other element. Defaults to normal browser behavior (both).

+

Resizable textareas

+

Easily configure the resize options for any textarea, or any other element. Defaults to normal browser behavior (both).

{% highlight css %} .resizable(@direction: both) { // Options: horizontal, vertical, both @@ -3266,8 +3240,8 @@ a { } {% endhighlight %} -

Truncating text

-

Easily truncate text with an ellipsis with a single mixin. Requires element to be block or inline-block level.

+

Truncating text

+

Easily truncate text with an ellipsis with a single mixin. Requires element to be block or inline-block level.

{% highlight css %} // Mixin .text-truncate() { @@ -3284,8 +3258,8 @@ a { } {% endhighlight %} -

Retina images

-

Specify two image paths and the @1x image dimensions, and Bootstrap will provide an @2x media query. If you have many images to serve, consider writing your retina image CSS manually in a single media query.

+

Retina images

+

Specify two image paths and the @1x image dimensions, and Bootstrap will provide an @2x media query. If you have many images to serve, consider writing your retina image CSS manually in a single media query.

{% highlight css %} .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { background-image: url("@{file-1x}"); @@ -3307,86 +3281,84 @@ a { .retina-image("/img/bg-1x.png", "/img/bg-2x.png", 100px, 100px); } {% endhighlight %} -
- - +
- -
- -

While Bootstrap is built on Less, it also has an official Sass port. We maintain it in a separate GitHub repository and handle updates with a conversion script.

-

What's included

-

Since the Sass port has a separate repo and serves a slightly different audience, the contents of the project differ greatly from the main Bootstrap project. This ensures the Sass port is as compatible with as many Sass-based systems as possible.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PathDescription
lib/Ruby gem code (Sass configuration, Rails and Compass integrations)
tasks/Converter scripts (turning upstream Less to Sass)
test/Compilation tests
templates/Compass package manifest
vendor/assets/Sass, JavaScript, and font files
RakefileInternal tasks, such as rake and convert
-
-

Visit the Sass port's GitHub repository to see this files in action.

+ +
+

Using Sass

+

While Bootstrap is built on Less, it also has an official Sass port. We maintain it in a separate GitHub repository and handle updates with a conversion script.

+ +

What's included

+

Since the Sass port has a separate repo and serves a slightly different audience, the contents of the project differ greatly from the main Bootstrap project. This ensures the Sass port is as compatible with as many Sass-based systems as possible.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathDescription
lib/Ruby gem code (Sass configuration, Rails and Compass integrations)
tasks/Converter scripts (turning upstream Less to Sass)
test/Compilation tests
templates/Compass package manifest
vendor/assets/Sass, JavaScript, and font files
RakefileInternal tasks, such as rake and convert
+
+

Visit the Sass port's GitHub repository to see this files in action.

-

Installation

-

Use the appropriate guide for your environment of choice.

+

Installation

+

Use the appropriate guide for your environment of choice.

-

Rails

+

Rails

-

bootstrap-sass is easy to drop into Rails with the asset pipeline.

+

bootstrap-sass is easy to drop into Rails with the asset pipeline.

-

In your Gemfile you need to add the bootstrap-sass gem, and ensure that the sass-rails gem is present—it is added to new Rails applications by default.

+

In your Gemfile you need to add the bootstrap-sass gem, and ensure that the sass-rails gem is present—it is added to new Rails applications by default.

{% highlight ruby %} gem 'sass-rails', '>= 3.2' # sass-rails needs to be higher than 3.2 gem 'bootstrap-sass', '~> 3.0.3.0' {% endhighlight %} -

bundle install and restart your server to make the files available through the pipeline.

+

bundle install and restart your server to make the files available through the pipeline.

-

Compass without Rails

+

Compass without Rails

-

Install the gem:

+

Install the gem:

{% highlight bash %} gem install bootstrap-sass {% endhighlight %} -

If you have an existing Compass project:

+

If you have an existing Compass project:

{% highlight ruby %} # config.rb: @@ -3397,44 +3369,44 @@ require 'bootstrap-sass' bundle exec compass install bootstrap {% endhighlight %} -

If you are creating a new Compass project, you can generate it with bootstrap-sass support:

+

If you are creating a new Compass project, you can generate it with bootstrap-sass support:

{% highlight bash %} bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap {% endhighlight %} -

This will create a new Compass project with the following files in it:

+

This will create a new Compass project with the following files in it:

-
    -
  • _variables.scss — all of bootstrap variables (override them here). -
  • -
  • styles.scss — main project SCSS file, import `variables` and `bootstrap`.
  • -
+
    +
  • _variables.scss — all of bootstrap variables (override them here). +
  • +
  • styles.scss — main project SCSS file, import `variables` and `bootstrap`.
  • +
-

Sass-only without Compass or Rails

+

Sass-only without Compass or Rails

-

Require the gem, and load paths and Sass helpers will be configured automatically:

+

Require the gem, and load paths and Sass helpers will be configured automatically:

{% highlight ruby %} require 'bootstrap-sass' {% endhighlight %} -

Using bootstrap-sass as a Bower package is still being tested. You can install it with:

+

Using bootstrap-sass as a Bower package is still being tested. You can install it with:

{% highlight bash %} bower install 'git://github.com/twbs/bootstrap-sass.git#v3.0.3.0' {% endhighlight %} -

JS and fonts

+

JS and fonts

-

If you are using Rails or Sprockets, see Usage. If none of Rails/Sprockets/Compass were detected the fonts will be referenced as:

+

If you are using Rails or Sprockets, see Usage. If none of Rails/Sprockets/Compass were detected the fonts will be referenced as:

{% highlight sass %} "#{$icon-font-path}/#{$icon-font-name}.eot" {% endhighlight %} -

$icon-font-path defaults to bootstrap/. When not using an asset pipeline, you have to copy fonts and javascripts from the gem.

+

$icon-font-path defaults to bootstrap/. When not using an asset pipeline, you have to copy fonts and javascripts from the gem.

{% highlight bash %} mkdir public/fonts @@ -3443,7 +3415,7 @@ mkdir public/javascripts cp -r $(bundle show bootstrap-sass)/vendor/assets/javascripts/ public/javascripts/ {% endhighlight %} -

In ruby you can get the assets' location in the filesystem like this:

+

In ruby you can get the assets' location in the filesystem like this:

{% highlight ruby %} Bootstrap.stylesheets_path @@ -3452,23 +3424,23 @@ Bootstrap.javascripts_path {% endhighlight %} -

Usage

+

Usage

-

Sass

+

Sass

-

Import Bootstrap into a Sass file (for example, application.css.scss) to get all of Bootstrap's styles, mixins and variables! We recommend against using //= require directives, since none of your other stylesheets will be able to access the Bootstrap mixins or variables.

+

Import Bootstrap into a Sass file (for example, application.css.scss) to get all of Bootstrap's styles, mixins and variables! We recommend against using //= require directives, since none of your other stylesheets will be able to access the Bootstrap mixins or variables.

{% highlight sass %} @import "bootstrap"; {% endhighlight %} -

You can also include optional Bootstrap theme:

+

You can also include optional Bootstrap theme:

{% highlight sass %} @import "bootstrap/theme"; {% endhighlight %} -

The full list of Bootstrap variables can be found in the Customizer. You can override these by simply redefining the variable before the @import directive, e.g.:

+

The full list of Bootstrap variables can be found in the Customizer. You can override these by simply redefining the variable before the @import directive, e.g.:

{% highlight sass %} $navbar-default-bg: #312312; @@ -3478,7 +3450,7 @@ $navbar-default-color: $light-orange; @import "bootstrap"; {% endhighlight %} -

You can also import components explicitly. To start with a full list of modules copy this file from the gem:

+

You can also import components explicitly. To start with a full list of modules copy this file from the gem:

{% highlight bash %} # copy and prepend "bootstrap/" to the @import paths: @@ -3487,30 +3459,28 @@ $(bundle show bootstrap-sass)/vendor/assets/stylesheets/bootstrap/bootstrap.scss app/assets/stylesheets/bootstrap-custom.scss {% endhighlight %} -

In your application.sass, replace @import 'bootstrap' with:

+

In your application.sass, replace @import 'bootstrap' with:

{% highlight sass %} @import 'bootstrap-custom'; {% endhighlight %} -

Comment out any components you do not want from bootstrap-custom.

+

Comment out any components you do not want from bootstrap-custom.

-

JavaScript

+

JavaScript

-

We have a helper that includes all Bootstrap javascripts. If you use Rails (or Sprockets separately), put this in your Javascript manifest (usually in application.js) to load the files in the [correct order](/vendor/assets/javascripts/bootstrap.js):

+

We have a helper that includes all Bootstrap javascripts. If you use Rails (or Sprockets separately), put this in your Javascript manifest (usually in application.js) to load the files in the [correct order](/vendor/assets/javascripts/bootstrap.js):

{% highlight js %} // Loads all Bootstrap javascripts //= require bootstrap {% endhighlight %} -

You can also load individual modules, provided you also require any dependencies. You can check dependencies in the [Bootstrap JS documentation][jsdocs].

+

You can also load individual modules, provided you also require any dependencies. You can check dependencies in the [Bootstrap JS documentation][jsdocs].

{% highlight js %} //= require bootstrap/scrollspy //= require bootstrap/modal //= require bootstrap/dropdown {% endhighlight %} - - -
+
-- cgit v1.2.3