docs.html 269.67 KiB
---
layout: default
title: Getting started
description: Overview of the project, its contents, and how to get started with a simple template.
---
<div class="bs-docs-container">
  <!-- Welcome
  ================================================== -->
  <div id="welcome" class="bs-docs-section-header">
    <h1>Welcome</h1>
    <p class="lead">Welcome to the Bootstrap documentation, the living, interactive style and code guide for all things Bootstrap. If you're new here, continue reading to learn how to get started. Otherwise, carry on you beautiful person you.</p>
  </div>
  <!-- Getting started
  ================================================== -->
  <div class="bs-docs-section" id="getting-started">
    <div class="page-header">
      <h1>Getting started</h1>
    </div>
    <p class="lead">There are three easy ways to quickly get started with Bootstrap, each one appealing to a different skill level and use case. Read through to see what suits your particular needs.</p>
    <div class="row">
      <div class="col-span-6">
        <h2>Compiled CSS and JS</h2>
        <p><strong>The fastest way to get started:</strong> get the compiled and minified versions of our CSS, JavaScript, and fonts. No documentation or original source files are included.</p>
        <p><a class="btn btn-large btn-primary" href="assets/bootstrap.zip" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Download', 'Download compiled']);">Download Bootstrap</a></p>
      </div>
      <div class="col-span-6">
        <h2>Project source code</h2>
        <p>Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.</p>
        <p><a class="btn btn-large" href="https://github.com/twitter/bootstrap/zipball/master" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Download', 'Download source']);">Download Bootstrap source</a></p>
      </div>
      <div class="col-span-6">
        <h2>Bower</h2>
        <p>Install and manage the original files for all CSS and JavaScript, along with a local copy of the docs, using <a href="http://twitter.github.com/bower">Bower</a>.</p>
        {% highlight bash %}$ bower install bootstrap{% endhighlight %}
      </div>
    </div>
  </div>
  <!-- File structure
  ================================================== -->
  <div class="bs-docs-section" id="whats-included">
    <div class="page-header">
      <h1>What's included</h1>
    </div>
    <p class="lead">Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations.</p>
    <p>Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:</p>
{% highlight bash %}
  bootstrap/
  ├── css/
  │   ├── bootstrap.css
  │   ├── bootstrap.min.css
  ├── js/
  │   ├── bootstrap.js
  │   ├── bootstrap.min.js
  └── fonts/
      ├── glyphiconshalflings-regular.eot
      ├── glyphiconshalflings-regular.otf
      ├── glyphiconshalflings-regular.svg
      ├── glyphiconshalflings-regular.ttf
      └── glyphiconshalflings-regular.woff
{% endhighlight %}
    <p>This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (<code>bootstrap.*</code>), as well as compiled and minified CSS and JS (<code>bootstrap.min.*</code>). The image files are compressed using <a href="http://imageoptim.com/">ImageOptim</a>, a Mac app for compressing PNGs.</p>
    <p>Please note that <strong>all JavaScript plugins require jQuery</strong> to be included.</p>
  </div>
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
<!-- Examples ================================================== --> <div class="bs-docs-section" id="examples"> <div class="page-header"> <h1>Templates and examples</h1> </div> <p class="lead">Make use of a super basic HTML template, or dive into a few examples we've started for you. We encourage folks to iterate on these examples and not simply use them as an end result.</p> <h3>HTML template</h3> {% highlight html linenos %} <!DOCTYPE html> <html> <head> <title>Bootstrap 101 Template</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> </head> <body> <h1>Hello, world!</h1> <script src="http://code.jquery.com/jquery.js"></script> <script src="js/bootstrap.min.js"></script> <!-- Optionally enable responsive features in IE8 --> <script src="js/respond.js"></script> </body> </html> {% endhighlight %} <h3>Examples</h3> <div class="row bs-docs-examples"> <div class="col-span-4"> <a class="thumbnail" href="/examples/starter-template/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-starter.png" alt=""> </a> <h4>Starter template</h4> <p>A barebones HTML document with all the Bootstrap CSS and JavaScript included.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/jumbotron/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-marketing.png" alt=""> </a> <h4>Basic marketing site</h4> <p>Featuring a hero unit for a primary message and three supporting elements.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/jumbotron-narrow/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-jumbotron-narrow.png" alt=""> </a> <h4>Narrow marketing</h4> <p>Slim, lightweight marketing template for small projects or teams.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/justified-nav/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-justified-nav.png" alt=""> </a> <h4>Justified nav</h4> <p>Marketing page with equal-width navigation links in a modified navbar.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/signin/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-signin.png" alt=""> </a> <h4>Sign in</h4> <p>Barebones sign in form with custom, larger form controls and a flexible layout.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/sticky-footer/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-sticky-footer.png" alt="">
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
</a> <h4>Sticky footer</h4> <p>Pin a fixed-height footer to the bottom of the user's viewport.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/sticky-footer-navbar/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-sticky-footer-navbar.png" alt=""> </a> <h4>Sticky footer w/ navbar</h4> <p>Add a fixed navbar to the default sticky footer template.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/carousel/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-carousel.png" alt=""> </a> <h4>Carousel jumbotron</h4> <p>An interactive riff on the basic marketing site featuring a prominent carousel.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/navbar/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-navbar.png" alt=""> </a> <h4>Navbar</h4> <p>Basic template for showcasing how the navbar works.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/navbar-static-top/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-navbar-static-top.png" alt=""> </a> <h4>Static top navbar</h4> <p>Basic template for showcasing the static navbar variation.</p> </div> <div class="col-span-4"> <a class="thumbnail" href="/examples/navbar-fixed-top/" target="_blank"> <img src="/assets/img/examples/bootstrap-example-navbar-fixed-top.png" alt=""> </a> <h4>Fixed top navbar</h4> <p>Basic template for showcasing the fixed navbar variation.</p> </div> </div> </div> <div class="bs-docs-section-header" id="css"> <h1>CSS</h1> <p class="lead">Fundamental HTML elements styled and enhanced with extensible classes.</p> </div> <!-- Global Bootstrap settings ================================================== --> <div class="bs-docs-section" id="css-overview"> <div class="page-header"> <h1>Overview</h1> </div> <p class="lead">Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.</p> <h3>HTML5 doctype required</h3> <p>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.</p> {% highlight html linenos %} <!DOCTYPE html> <html lang="en"> ... </html> {% endhighlight %}
211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
<h3>Mobile first</h3> <p>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, <strong>Bootstrap is mobile first</strong>. Mobile first styles can be found throughout the entire library instead of in separate files.</p> <p>To ensure proper rendering and touch zooming, <strong>add the viewport meta tag</strong> to your <code>&lt;head&gt;</code>.</p> {% highlight html linenos %} <meta name="viewport" content="width=device-width, initial-scale=1.0"> {% endhighlight %} <h3>Typography and links</h3> <p>Bootstrap sets basic global display, typography, and link styles. Specifically, we:</p> <ul> <li>Remove <code>margin</code> on the body</li> <li>Set <code>background-color: white;</code> on the <code>body</code></li> <li>Use the <code>@font-family-base</code>, <code>@font-size-base</code>, and <code>@line-height-base</code> attributes as our typographic base</li> <li>Set the global link color via <code>@link-color</code> and apply link underlines only on <code>:hover</code></li> </ul> <p>These styles can be found within <strong>scaffolding.less</strong>.</p> <h3>Normalize reset</h3> <p>For improved cross-browser rendering, we use <a href="http://necolas.github.com/normalize.css/" target="_blank">Normalize</a>, a project by <a href="http://twitter.com/necolas" target="_blank">Nicolas Gallagher</a> and <a href="http://twitter.com/jon_neal" target="_blank">Jonathan Neal</a>.</p> </div> <!-- Grid system ================================================== --> <div class="bs-docs-section" id="grid"> <div class="page-header"> <h1>Grid system</h1> </div> <p class="lead">Bootstrap includes a responsive, percent-based grid system that appropriately scales up to 12 columns as the device or viewport size increases&mdash;in other words, it's mobile first. It includes <a href="#grid-example">predefined classes</a> for this, as well as powerful <a href="#grid-less">mixins for generating semantic layouts</a>.</p> <h3 id="grid-example">Grid example</h3> <p>On mobile devices, the grid starts out stacked. Above 768px, it becomes horizontal as media queries kick in to apply <code>float</code>s and <code>width</code>s. To create a basic grid layout, wrap a series of <code>.col-span-*</code> elements within a <code>.row</code>. As this is a 12-column grid, each <code>.span*</code> spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent), even at mobile resolutions.</p> <div class="bs-docs-grid"> <div class="row show-grid"> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> </div> <div class="row show-grid"> <div class="col-span-4">4</div> <div class="col-span-4">4</div> <div class="col-span-4">4</div> </div> <div class="row show-grid"> <div class="col-span-6">6</div> <div class="col-span-6">6</div> </div> </div> {% highlight html linenos %} <div class="row"> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div> <div class="col-span-1">1</div>
281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
<div class="col-span-1">1</div> </div> <div class="row"> <div class="col-span-4">4</div> <div class="col-span-4">4</div> <div class="col-span-4">4</div> </div> <div class="row"> <div class="col-span-6">6</div> <div class="col-span-6">6</div> </div> {% endhighlight %} <h3 id="grid-offsetting">Offsetting columns</h3> <p>Move columns to the right using <code>.col-offset-*</code> classes. Each class increases the left margin of a column by a whole column. For example, <code>.col-offset-4</code> moves <code>.col-span-4</code> over four columns.</p> <div class="bs-docs-grid"> <div class="row show-grid"> <div class="col-span-4">4</div> <div class="col-span-4 col-offset-4">4 offset 4</div> </div><!-- /row --> <div class="row show-grid"> <div class="col-span-3 col-offset-3">3 offset 3</div> <div class="col-span-3 col-offset-3">3 offset 3</div> </div><!-- /row --> <div class="row show-grid"> <div class="col-span-6 col-offset-6">6 offset 6</div> </div><!-- /row --> </div> {% highlight html linenos %} <div class="row"> <div class="col-span-4">...</div> <div class="col-span-4 col-offset-4">...</div> </div> {% endhighlight %} <h3 id="grid-nesting">Nesting columns</h3> <p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.span*</code> columns within an existing <code>.span*</code> column. Nested rows should include a set of columns that add up to 12.</p> <div class="row show-grid"> <div class="col-span-9"> Level 1: 9 columns <div class="row show-grid"> <div class="col-span-6"> Level 2: 6 columns </div> <div class="col-span-6"> Level 2: 6 columns </div> </div> </div> </div> {% highlight html linenos %} <div class="row"> <div class="col-span-9"> Level 1: 9 columns <div class="row"> <div class="col-span-6"> Level 2: 6 columns </div> <div class="col-span-6"> Level 2: 6 columns </div> </div> </div> </div> {% endhighlight %} <h3 id="grid-column-ordering">Column ordering</h3> <p>Easily change the order of our built-in grid columns with <code>.push*</code> and <code>.pull*</code> modifier classes.</p> <div class="row show-grid">
351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
<div class="col-span-9 col-push-3">9</div> <div class="col-span-3 col-pull-9">3</div> </div> {% highlight html linenos %} <div class="row show-grid"> <div class="col-span-9 col-push-3">9</div> <div class="col-span-3 col-pull-9">3</div> </div> {% endhighlight %} <h3 id="grid-less">LESS mixins and variables</h3> <p>In addition to <a href="#grid-example">prebuilt grid classes</a> for fast layouts, Bootstrap includes LESS variables and mixins for quickly generating your own simple, semantic layouts.</p> <h4>Variables</h4> <p>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.</p> {% highlight css linenos %} @grid-columns: 12; @grid-gutter-width: 30px; @grid-float-breakpoint: 768px; {% endhighlight %} <h4>Mixins</h4> <p>Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.</p> {% highlight css linenos %} // Creates a wrapper for a series of columns .make-row() { // Negative margin the row out to align the content of columns margin-left: (@grid-gutter-width / -2); margin-right: (@grid-gutter-width / -2); // Then clear the floated columns .clear_float(); } // Generate the columns .make-column(@columns) { @media (min-width: @grid-float-breakpoint) { float: left; // Calculate width based on number of columns available width: percentage(@columns / @grid-columns); } // Prevent columns from collapsing when empty min-height: 1px; // Set inner padding as gutters instead of margin padding-left: (@grid-gutter-width / 2); padding-right: (@grid-gutter-width / 2); } // Generate the column offsets .make-column-offset(@columns) { @media (min-width: @grid-float-breakpoint) { margin-left: percentage((@columns / @grid-columns)); } } {% endhighlight %} <h4>Example usage</h4> <p>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.</p> {% highlight css linenos %} .wrapper { .make-row(); } .content-main { .make-column(8); } .content-secondary { .make-column(3); .make-column-offset(1); } {% endhighlight %}
421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
{% highlight html linenos %} <div class="wrapper"> <div class="content-main">...</div> <div class="content-secondary">...</div> </div> {% endhighlight %} </div> <!-- Typography ================================================== --> <div class="bs-docs-section" id="typography"> <div class="page-header"> <h1>Typography</h1> </div> <!-- Headings --> <h2 id="headings">Headings</h2> <p>All HTML headings, <code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code> are available.</p> <div class="bs-docs-example bs-docs-example-type"> <table class="table"> <tbody> <tr> <th><h1>Bootstrap heading</h1></th> <td>Semibold 38px</td> </tr> <tr> <th><h2>Bootstrap heading</h2></th> <td>Semibold 32px</td> </tr> <tr> <th><h3>Bootstrap heading</h3></th> <td>Semibold 24px</td> </tr> <tr> <th><h4>Bootstrap heading</h4></th> <td>Semibold 18px</td> </tr> <tr> <th><h5>Bootstrap heading</h5></th> <td>Semibold 16px</td> </tr> <tr> <th><h6>Bootstrap heading</h6></th> <td>Semibold 12px</td> </tr> </tbody> </table> </div> <!-- Body copy --> <h2 id="body-copy">Body copy</h2> <p>Bootstrap's global default <code>font-size</code> is <strong>14px</strong>, with a <code>line-height</code> of <strong>20px</strong>. This is applied to the <code>&lt;body&gt;</code> and all paragraphs. In addition, <code>&lt;p&gt;</code> (paragraphs) receive a bottom margin of half their line-height (10px by default).</p> <div class="bs-docs-example"> <p>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.</p> <p>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.</p> <p>Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p> </div> {% highlight html linenos %} <p>...</p> {% endhighlight %} <!-- Body copy .lead --> <h3>Lead body copy</h3>
491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
<p>Make a paragraph stand out by adding <code>.lead</code>.</p> <div class="bs-docs-example"> <p class="lead">Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.</p> </div> {% highlight html linenos %} <p class="lead">...</p> {% endhighlight %} <!-- Using LESS --> <h3>Built with Less</h3> <p>The typographic scale is based on two LESS variables in <strong>variables.less</strong>: <code>@font-size-base</code> and <code>@line-height-base</code>. 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.</p> <!-- Emphasis --> <h2 id="emphasis">Emphasis</h2> <p>Make use of HTML's default emphasis tags with lightweight styles.</p> <h3>Small text</h3> <p>For de-emphasizing inline or blocks of text, <small>use the small tag.</small></p> <div class="bs-docs-example"> <p><small>This line of text is meant to be treated as fine print.</small></p> </div> {% highlight html linenos %} <small>This line of text is meant to be treated as fine print.</small> {% endhighlight %} <h3>Bold</h3> <p>For emphasizing a snippet of text with a heavier font-weight.</p> <div class="bs-docs-example"> <p>The following snippet of text is <strong>rendered as bold text</strong>.</p> </div> {% highlight html linenos %} <strong>rendered as bold text</strong> {% endhighlight %} <h3>Italics</h3> <p>For emphasizing a snippet of text with italics.</p> <div class="bs-docs-example"> <p>The following snippet of text is <em>rendered as italicized text</em>.</p> </div> {% highlight html linenos %} <em>rendered as italicized text</em> {% endhighlight %} <p>Feel free to use <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> in HTML5. <code>&lt;b&gt;</code> is meant to highlight words or phrases without conveying additional importance while <code>&lt;i&gt;</code> is mostly for voice, technical terms, etc.</p> <h3>Alignment classes</h3> <p>Easily realign text to components with text alignment classes.</p> <div class="bs-docs-example"> <p class="text-left">Left aligned text.</p> <p class="text-center">Center aligned text.</p> <p class="text-right">Right aligned text.</p> </div> {% highlight html linenos %} <p class="text-left">Left aligned text.</p> <p class="text-center">Center aligned text.</p> <p class="text-right">Right aligned text.</p> {% endhighlight %} <h3>Emphasis classes</h3> <p>Convey meaning through color with a handful of emphasis utility classes.</p> <div class="bs-docs-example"> <p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p> <p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p> <p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p> <p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p> </div> {% highlight html linenos %} <p class="muted">...</p>
561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
<p class="text-warning">...</p> <p class="text-error">...</p> <p class="text-success">...</p> {% endhighlight %} <!-- Abbreviations --> <h2 id="abbreviations">Abbreviations</h2> <p>Stylized implementation of HTML's <code>&lt;abbr&gt;</code> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a <code>title</code> attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover.</p> <h3>Basic abbreviation</h3> <p>For expanded text on long hover of an abbreviation, include the <code>title</code> attribute with the <code>&lt;abbr&gt;</code> element.</p> <div class="bs-docs-example"> <p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p> </div> {% highlight html linenos %} <abbr title="attribute">attr</abbr> {% endhighlight %} <h3>Initialism</h3> <p>Add <code>.initialism</code> to an abbreviation for a slightly smaller font-size.</p> <div class="bs-docs-example"> <p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr> is the best thing since sliced bread.</p> </div> {% highlight html linenos %} <abbr title="HyperText Markup Language" class="initialism">HTML</abbr> {% endhighlight %} <!-- Addresses --> <h2 id="addresses">Addresses</h2> <p>Present contact information for the nearest ancestor or the entire body of work. Preserve formatting by ending all lines with <code>&lt;br&gt;</code>.</p> <div class="bs-docs-example"> <address> <strong>Twitter, Inc.</strong><br> 795 Folsom Ave, Suite 600<br> San Francisco, CA 94107<br> <abbr title="Phone">P:</abbr> (123) 456-7890 </address> <address> <strong>Full Name</strong><br> <a href="mailto:#">first.last@example.com</a> </address> </div> {% highlight html linenos %} <address> <strong>Twitter, Inc.</strong><br> 795 Folsom Ave, Suite 600<br> San Francisco, CA 94107<br> <abbr title="Phone">P:</abbr> (123) 456-7890 </address> <address> <strong>Full Name</strong><br> <a href="mailto:#">first.last@example.com</a> </address> {% endhighlight %} <!-- Blockquotes --> <h2 id="blockquotes">Blockquotes</h2> <p>For quoting blocks of content from another source within your document.</p> <h3>Default blockquote</h3> <p>Wrap <code>&lt;blockquote&gt;</code> around any <abbr title="HyperText Markup Language">HTML</abbr> as the quote. For straight quotes we recommend a <code>&lt;p&gt;</code>.</p> <div class="bs-docs-example"> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> </blockquote> </div>
631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
{% highlight html linenos %} <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> </blockquote> {% endhighlight %} <h3>Blockquote options</h3> <p>Style and content changes for simple variations on a standard blockquote.</p> <h4>Naming a source</h4> <p>Add <code>&lt;small&gt;</code> tag for identifying the source. Wrap the name of the source work in <code>&lt;cite&gt;</code>.</p> <div class="bs-docs-example"> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <small>Someone famous in <cite title="Source Title">Source Title</cite></small> </blockquote> </div> {% highlight html linenos %} <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <small>Someone famous <cite title="Source Title">Source Title</cite></small> </blockquote> {% endhighlight %} <h4>Alternate displays</h4> <p>Use <code>.pull-right</code> for a floated, right-aligned blockquote.</p> <div class="bs-docs-example" style="overflow: hidden;"> <blockquote class="pull-right"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <small>Someone famous in <cite title="Source Title">Source Title</cite></small> </blockquote> </div> {% highlight html linenos %} <blockquote class="pull-right"> ... </blockquote> {% endhighlight %} <!-- Lists --> <h2 id="lists">Lists</h2> <h3>Unordered</h3> <p>A list of items in which the order does <em>not</em> explicitly matter.</p> <div class="bs-docs-example"> <ul> <li>Lorem ipsum dolor sit amet</li> <li>Consectetur adipiscing elit</li> <li>Integer molestie lorem at massa</li> <li>Facilisis in pretium nisl aliquet</li> <li>Nulla volutpat aliquam velit <ul> <li>Phasellus iaculis neque</li> <li>Purus sodales ultricies</li> <li>Vestibulum laoreet porttitor sem</li> <li>Ac tristique libero volutpat at</li> </ul> </li> <li>Faucibus porta lacus fringilla vel</li> <li>Aenean sit amet erat nunc</li> <li>Eget porttitor lorem</li> </ul> </div> {% highlight html linenos %} <ul> <li>...</li> </ul> {% endhighlight %} <h3>Ordered</h3>
701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
<p>A list of items in which the order <em>does</em> explicitly matter.</p> <div class="bs-docs-example"> <ol> <li>Lorem ipsum dolor sit amet</li> <li>Consectetur adipiscing elit</li> <li>Integer molestie lorem at massa</li> <li>Facilisis in pretium nisl aliquet</li> <li>Nulla volutpat aliquam velit</li> <li>Faucibus porta lacus fringilla vel</li> <li>Aenean sit amet erat nunc</li> <li>Eget porttitor lorem</li> </ol> </div> {% highlight html linenos %} <ol> <li>...</li> </ol> {% endhighlight %} <h3>Unstyled</h3> <p>Remove the default <code>list-style</code> and left margin on list items (immediate children only). <strong>This only applies to immediate children list items</strong>, meaning you will need to add the class for any nested lists as well.</p> <div class="bs-docs-example"> <ul class="list-unstyled"> <li>Lorem ipsum dolor sit amet</li> <li>Consectetur adipiscing elit</li> <li>Integer molestie lorem at massa</li> <li>Facilisis in pretium nisl aliquet</li> <li>Nulla volutpat aliquam velit <ul> <li>Phasellus iaculis neque</li> <li>Purus sodales ultricies</li> <li>Vestibulum laoreet porttitor sem</li> <li>Ac tristique libero volutpat at</li> </ul> </li> <li>Faucibus porta lacus fringilla vel</li> <li>Aenean sit amet erat nunc</li> <li>Eget porttitor lorem</li> </ul> </div> {% highlight html linenos %} <ul class="list-unstyled"> <li>...</li> </ul> {% endhighlight %} <h3>Inline</h3> <p>Place all list items on a single line with <code>inline-block</code> and some light padding.</p> <div class="bs-docs-example"> <ul class="list-inline"> <li>Lorem ipsum</li> <li>Phasellus iaculis</li> <li>Nulla volutpat</li> </ul> </div> {% highlight html linenos %} <ul class="list-inline"> <li>...</li> </ul> {% endhighlight %} <h3>Description</h3> <p>A list of terms with their associated descriptions.</p> <div class="bs-docs-example"> <dl> <dt>Description lists</dt> <dd>A description list is perfect for defining terms.</dd> <dt>Euismod</dt> <dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.</dd> <dd>Donec id elit non mi porta gravida at eget metus.</dd>
771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
<dt>Malesuada porta</dt> <dd>Etiam porta sem malesuada magna mollis euismod.</dd> </dl> </div> {% highlight html linenos %} <dl> <dt>...</dt> <dd>...</dd> </dl> {% endhighlight %} <h4>Horizontal description</h4> <p>Make terms and descriptions in <code>&lt;dl&gt;</code> line up side-by-side.</p> <div class="bs-docs-example"> <dl class="dl-horizontal"> <dt>Description lists</dt> <dd>A description list is perfect for defining terms.</dd> <dt>Euismod</dt> <dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.</dd> <dd>Donec id elit non mi porta gravida at eget metus.</dd> <dt>Malesuada porta</dt> <dd>Etiam porta sem malesuada magna mollis euismod.</dd> <dt>Felis euismod semper eget lacinia</dt> <dd>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</dd> </dl> </div> {% highlight html linenos %} <dl class="dl-horizontal"> <dt>...</dt> <dd>...</dd> </dl> {% endhighlight %} <h5>Auto-truncating</h5> <p> Horizontal description lists will truncate terms that are too long to fit in the left column fix <code>text-overflow</code>. In narrower viewports, they will change to the default stacked layout. </p> </div> <!-- Code ================================================== --> <div class="bs-docs-section" id="code"> <div class="page-header"> <h1>Code</h1> </div> <h2>Inline</h2> <p>Wrap inline snippets of code with <code>&lt;code&gt;</code>.</p> <div class="bs-docs-example"> For example, <code>&lt;section&gt;</code> should be wrapped as inline. </div> {% highlight html linenos %} For example, <code>&lt;section&gt;</code> should be wrapped as inline. {% endhighlight %} <h2>Basic block</h2> <p>Use <code>&lt;pre&gt;</code> for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.</p> <div class="bs-docs-example"> <pre>&lt;p&gt;Sample text here...&lt;/p&gt;</pre> </div> {% highlight html linenos %} <pre>&lt;p&gt;Sample text here...&lt;/p&gt;</pre> {% endhighlight %} <p>You may optionally add the <code>.pre-scrollable</code> class which will set a max-height of 350px and provide a y-axis scrollbar.</p> </div>
841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
<!-- Tables ================================================== --> <div class="bs-docs-section" id="tables"> <div class="page-header"> <h1>Tables</h1> </div> <h2>Default styles</h2> <p>For basic styling&mdash;light padding and only horizontal dividers&mdash;add the base class <code>.table</code> to any <code>&lt;table&gt;</code>. 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.</p> <div class="bs-docs-example"> <table class="table"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <td>2</td> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <td>3</td> <td>Larry</td> <td>the Bird</td> <td>@twitter</td> </tr> </tbody> </table> </div><!-- /example --> {% highlight html linenos %} <table class="table"> ... </table> {% endhighlight %} <h2>Optional classes</h2> <p>Add any of the following classes to the <code>.table</code> base class.</p> <h3>Striped</h3> <p>Use <code>.table-striped</code> to add zebra-striping to any table row within the <code>&lt;tbody&gt;</code> via the <code>:nth-child</code> CSS selector (not available in IE8).</p> <div class="bs-docs-example"> <table class="table table-striped"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Mark</td>
911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980
<td>Otto</td> <td>@mdo</td> </tr> <tr> <td>2</td> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <td>3</td> <td>Larry</td> <td>the Bird</td> <td>@twitter</td> </tr> </tbody> </table> </div><!-- /example --> {% highlight html linenos %} <table class="table table-striped"> ... </table> {% endhighlight %} <h3>Bordered</h3> <p>Add <code>.table-bordered</code> for borders and rounded corners.</p> <div class="bs-docs-example"> <table class="table table-bordered"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <td rowspan="2">1</td> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <td>Mark</td> <td>Otto</td> <td>@TwBootstrap</td> </tr> <tr> <td>2</td> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <td>3</td> <td colspan="2">Larry the Bird</td> <td>@twitter</td> </tr> </tbody> </table> </div><!-- /example --> {% highlight html linenos %} <table class="table table-bordered"> ... </table> {% endhighlight %} <h3>Hover rows</h3> <p>Add <code>.table-hover</code> to enable a hover state on table rows within a <code>&lt;tbody&gt;</code>.</p>
981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
<div class="bs-docs-example"> <table class="table table-hover"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <td>2</td> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <td>3</td> <td colspan="2">Larry the Bird</td> <td>@twitter</td> </tr> </tbody> </table> </div><!-- /example --> {% highlight html linenos %} <table class="table table-hover"> ... </table> {% endhighlight %} <h3>Condensed</h3> <p>Add <code>.table-condensed</code> to make tables more compact by cutting cell padding in half.</p> <div class="bs-docs-example"> <table class="table table-condensed"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <td>2</td> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <td>3</td> <td colspan="2">Larry the Bird</td> <td>@twitter</td> </tr> </tbody> </table>
1051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
</div><!-- /example --> {% highlight html linenos %} <table class="table table-condensed"> ... </table> {% endhighlight %} <h2>Optional row classes</h2> <p>Use contextual classes to color table rows.</p> <table class="table table-bordered table-striped"> <colgroup> <col class="span1"> <col class="span7"> </colgroup> <thead> <tr> <th>Class</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <code>.success</code> </td> <td>Indicates a successful or positive action.</td> </tr> <tr> <td> <code>.error</code> </td> <td>Indicates a dangerous or potentially negative action.</td> </tr> <tr> <td> <code>.warning</code> </td> <td>Indicates a warning that might need attention.</td> </tr> <tr> <td> <code>.info</code> </td> <td>Used as an alternative to the default styles.</td> </tr> </tbody> </table> <div class="bs-docs-example"> <table class="table"> <thead> <tr> <th>#</th> <th>Product</th> <th>Payment Taken</th> <th>Status</th> </tr> </thead> <tbody> <tr class="success"> <td>1</td> <td>TB - Monthly</td> <td>01/04/2012</td> <td>Approved</td> </tr> <tr class="error"> <td>2</td> <td>TB - Monthly</td> <td>02/04/2012</td>
1121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
<td>Declined</td> </tr> <tr class="warning"> <td>3</td> <td>TB - Monthly</td> <td>03/04/2012</td> <td>Pending</td> </tr> </tbody> </table> </div><!-- /example --> {% highlight html linenos %} ... <tr class="success"> <td>1</td> <td>TB - Monthly</td> <td>01/04/2012</td> <td>Approved</td> </tr> ... {% endhighlight %} <h2>Supported table markup</h2> <p>List of supported table HTML elements and how they should be used.</p> <table class="table table-bordered table-striped"> <colgroup> <col class="span1"> <col class="span7"> </colgroup> <thead> <tr> <th>Tag</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <code>&lt;table&gt;</code> </td> <td> Wrapping element for displaying data in a tabular format </td> </tr> <tr> <td> <code>&lt;thead&gt;</code> </td> <td> Container element for table header rows (<code>&lt;tr&gt;</code>) to label table columns </td> </tr> <tr> <td> <code>&lt;tbody&gt;</code> </td> <td> Container element for table rows (<code>&lt;tr&gt;</code>) in the body of the table </td> </tr> <tr> <td> <code>&lt;tr&gt;</code> </td> <td> Container element for a set of table cells (<code>&lt;td&gt;</code> or <code>&lt;th&gt;</code>) that appears on a single row </td> </tr>
1191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260
<tr> <td> <code>&lt;td&gt;</code> </td> <td> Default table cell </td> </tr> <tr> <td> <code>&lt;th&gt;</code> </td> <td> Special table cell for column (or row, depending on scope and placement) labels </td> </tr> <tr> <td> <code>&lt;caption&gt;</code> </td> <td> Description or summary of what the table holds, especially useful for screen readers </td> </tr> </tbody> </table> {% highlight html linenos %} <table> <caption>...</caption> <thead> <tr> <th>...</th> <th>...</th> <th>...</th> </tr> </thead> <tbody> <tr> <td>...</td> <td>...</td> <td>...</td> </tr> </tbody> </table> {% endhighlight %} </div> <!-- Forms ================================================== --> <div class="bs-docs-section" id="forms"> <div class="page-header"> <h1>Forms</h1> </div> <h2 id="forms-default">Default styles</h2> <p>Individual form controls automatically receive some global styling. By default, inputs are set to <code>width: 100%;</code>.</p> <form class="bs-docs-example"> <fieldset> <legend>Legend</legend> <label>Label name</label> <input type="text" placeholder="Type something…"> <p class="help-block">Example block-level help text here.</p> <div class="checkbox"> <label> <input type="checkbox"> Check me out </label> </div>
1261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330
<button type="submit" class="btn">Submit</button> </fieldset> </form><!-- /example --> {% highlight html linenos %} <form> <fieldset> <legend>Legend</legend> <label>Label name</label> <input type="text" placeholder="Type something…"> <p class="help-block">Example block-level help text here.</p> <div class="checkbox"> <label> <input type="checkbox"> Check me out </label> </div> <button type="submit" class="btn">Submit</button> </fieldset> </form> {% endhighlight %} <h2 id="forms-layouts">Optional layouts</h2> <p>Included with Bootstrap are optional form layouts for common use cases.</p> <h3>Inline form</h3> <p>Add <code>.form-inline</code> for left-aligned labels and inline-block controls for a compact layout.</p> <form class="bs-docs-example form-inline"> <input type="text" class="span3" placeholder="Email"> <input type="password" class="span3" placeholder="Password"> <div class="checkbox"> <label> <input type="checkbox"> Remember me </label> </div> <button type="submit" class="btn">Sign in</button> </form><!-- /example --> {% highlight html linenos %} <form class="form-inline"> <input type="text" class="span3" placeholder="Email"> <input type="password" class="span3" placeholder="Password"> <div class="checkbox"> <label> <input type="checkbox"> Remember me </label> </div> <button type="submit" class="btn">Sign in</button> </form> {% endhighlight %} <h3>Horizontal form</h3> <p>Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup changes from a default form:</p> <ul> <li>Add <code>.form-horizontal</code> to the form</li> <li>Wrap labels and controls in <code>.control-group</code></li> <li>Add <code>.control-label</code> to the label</li> <li>Wrap any associated controls in <code>.controls</code> for proper alignment</li> </ul> <form class="bs-docs-example form-horizontal"> <div class="control-group"> <label class="control-label" for="inputEmail">Email</label> <div class="controls"> <input type="text" id="inputEmail" placeholder="Email"> </div> </div> <div class="control-group"> <label class="control-label" for="inputPassword">Password</label> <div class="controls"> <input type="password" id="inputPassword" placeholder="Password"> <div class="checkbox"> <label>