css.html 78.75 KiB
---
layout: default
title: CSS
slug: css
lead: "Global CSS settings, fundamental HTML elements styled and enhanced with extensible classes, and an advanced grid system."
---
  <!-- Global Bootstrap settings
  ================================================== -->
  <div class="bs-docs-section" id="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 id="overview-doctype">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 %}
<!DOCTYPE html>
<html lang="en">
  ...
</html>
{% endhighlight %}
    <h3 id="overview-mobile">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 %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% endhighlight %}
    <h3 id="overview-type-links">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 id="overview-normalize">Normalize reset</h3>
    <p>For improved cross-browser rendering, we use <a href="http://necolas.github.io/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>
    <h3 id="overview-container">Centering with container</h3>
    <p>Easily center a page's contents by wrapping its contents in a container. Containers set <code>max-width</code> at various media query breakpoints to match our grid system.</p>
{% highlight html %}
<div class="container">
  ...
</div>
{% endhighlight %}
  </div>
  <!-- Glyphicons icon font
  ================================================== -->
  <div class="bs-docs-section" id="glyphicons">
    <div class="page-header">
      <h1>Glyphicons</h1>
    </div>
    <p class="lead">With the launch of Bootstrap 3, icons have been moved to a <a href="https://github.com/twbs/bootstrap-glyphicons">separate repository</a>. This keeps the primary project as lean as possible, makes it easier for folks to swap icon libraries, and makes Glyphicons icon fonts more readily available to more people outside Bootstrap.</p>
    <p class="lead">
      <a href="http://glyphicons.getbootstrap.com/" class="btn btn-default btn-large">Visit Glyphicons for Bootstrap</a> or <a href="https://github.com/twbs/bootstrap-glyphicons">download from GitHub</a>
    </p>
  </div>
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
<!-- 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, mobile-first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes <a href="#grid-example-basic">predefined classes</a> for easy layout options, as well as powerful <a href="#grid-less">mixins for generating more semantic layouts</a>.</p> <h3 id="grid-options">Grid options</h3> <p>See how aspects of the Bootstrap grid system work across multiple devices with a handy table.</p> <table class="table table-bordered table-striped bs-table"> <thead> <tr> <th></th> <th> Tiny grid <small>Phones (&lt;480px)</small> </th> <th> Small grid <small>Tablets (&lt;768px)</small> </th> <th> Medium-large grid <small>Destkops (&gt;768px)</small> </th> </tr> </thead> <tbody> <tr> <th>Grid behavior</th> <td>Horizontal at all times</td> <td colspan="2">Collapsed to start, horizontal above breakpoints</td> </tr> <tr> <th>Class prefix</th> <td><code>.col-</code></td> <td><code>.col-sm-</code></td> <td><code>.col-lg-</code></td> </tr> <tr> <th># of columns</th> <td colspan="3">12</td> </tr> <tr> <th>Nestable</th> <td colspan="3">Yes</td> </tr> <tr> <th>Offsets</th> <td colspan="2" class="text-muted">N/A</td> <td>Yes</td> </tr> <tr> <th>Column ordering</th> <td class="text-muted">N/A</td> <td colspan="2">Yes</td> </tr> </tbody> </table> <h3 id="grid-example-basic">Example: Stacked-to-horizontal</h3> <p>Using a single set of grid classes, you can create a basic grid system that starts out stacked on mobile and tablet devices before becoming horizontal on desktop devices.</p> <div class="bs-docs-grid"> <div class="row show-grid"> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div>
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
<div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> </div> <div class="row show-grid"> <div class="col-lg-8">8</div> <div class="col-lg-4">4</div> </div> <div class="row show-grid"> <div class="col-lg-4">4</div> <div class="col-lg-4">4</div> <div class="col-lg-4">4</div> </div> <div class="row show-grid"> <div class="col-lg-6">6</div> <div class="col-lg-6">6</div> </div> </div> {% highlight html %} <div class="row"> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> <div class="col-lg-1">1</div> </div> <div class="row show-grid"> <div class="col-lg-8">8</div> <div class="col-lg-4">4</div> </div> <div class="row"> <div class="col-lg-4">4</div> <div class="col-lg-4">4</div> <div class="col-lg-4">4</div> </div> <div class="row"> <div class="col-lg-6">6</div> <div class="col-lg-6">6</div> </div> {% endhighlight %} <h3 id="grid-example-mixed">Example: Combining mobile with desktop</h3> <p>Don't want your columns to simply stack in smaller devices? Use the small device grid system by adding <code>.col-*</code> classes to the existing <code>.col-lg-*</code> ones. See the example below for a better idea of how it all works.</p> <div class="bs-docs-grid"> <div class="row show-grid"> <div class="col-12 col-lg-8">8</div> <div class="col-6 col-lg-4">4</div> </div> <div class="row show-grid"> <div class="col-6 col-lg-4">4</div> <div class="col-6 col-lg-4">4</div> <div class="col-6 col-lg-4">4</div> </div> <div class="row show-grid"> <div class="col-6 col-lg-6">6</div> <div class="col-6 col-lg-6">6</div> </div> </div> {% highlight html %}
211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
<div class="row"> <div class="col-12 col-lg-8">8</div> <div class="col-6 col-lg-4">4</div> </div> <div class="row"> <div class="col-6 col-lg-4">4</div> <div class="col-6 col-lg-4">4</div> <div class="col-6 col-lg-4">4</div> </div> <div class="row"> <div class="col-6 col-lg-6">6</div> <div class="col-6 col-lg-6">6</div> </div> {% endhighlight %} <h3 id="grid-example-mixed-complete">Example: Mobile, tablet, and desktop</h3> <p>Build on the previous example by creating even more dynamic and powerful layouts with tablet <code>.col-sm-*</code> classes.</p> <div class="bs-docs-grid"> <div class="row show-grid"> <div class="col-12 col-sm-8 col-lg-8">.col-12 .col-lg-8</div> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> </div> <div class="row show-grid"> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> </div> <div class="row show-grid"> <div class="col-6 col-sm-6 col-lg-6">.col-6 .col-lg-6</div> <div class="col-6 col-sm-6 col-lg-6">.col-6 .col-lg-6</div> </div> </div> {% highlight html %} <div class="row"> <div class="col-12 col-sm-8 col-lg-8">.col-12 .col-lg-8</div> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> </div> <div class="row"> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> <div class="col-6 col-sm-4 col-lg-4">.col-6 .col-lg-4</div> </div> <div class="row"> <div class="col-6 col-sm-6 col-lg-6">.col-6 .col-lg-6</div> <div class="col-6 col-sm-6 col-lg-6">.col-6 .col-lg-6</div> </div> {% endhighlight %} <div class="bs-callout bs-callout-danger"> <h4>Need more examples?</h4> <p>We dive into more grid layouts in a separate page, free of chrome and documentation to better show you the power of the grid.</p> <p><a class="btn btn-danger" target="_blank" href="http://examples.getbootstrap.com/grid/">More grid examples</a></p> </div> <h3 id="grid-offsetting">Offsetting columns</h3> <p>Move columns to the right using <code>.col-offset-*</code> classes. These classes increase the left margin of a column by <code>*</code> columns. For example, <code>.col-offset-4</code> moves <code>.col-lg-4</code> over four columns.</p> <div class="bs-docs-grid"> <div class="row show-grid"> <div class="col-lg-4">4</div> <div class="col-lg-4 col-offset-4">4 offset 4</div> </div><!-- /row --> <div class="row show-grid"> <div class="col-lg-3 col-offset-3">3 offset 3</div> <div class="col-lg-3 col-offset-3">3 offset 3</div> </div><!-- /row --> <div class="row show-grid"> <div class="col-lg-6 col-offset-3">6 offset 3</div> </div><!-- /row --> </div> {% highlight html %}
281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
<div class="row"> <div class="col-lg-4">...</div> <div class="col-lg-4 col-offset-4">...</div> </div> <div class="row"> <div class="col-lg-3 col-offset-3">3 offset 3</div> <div class="col-lg-3 col-offset-3">3 offset 3</div> </div> <div class="row"> <div class="col-lg-6 col-offset-3">...</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>.col-lg-*</code> columns within an existing <code>.col-lg-*</code> column. Nested rows should include a set of columns that add up to 12.</p> <div class="row show-grid"> <div class="col-lg-9"> Level 1: 9 columns <div class="row show-grid"> <div class="col-lg-6"> Level 2: 6 columns </div> <div class="col-lg-6"> Level 2: 6 columns </div> </div> </div> </div> {% highlight html %} <div class="row"> <div class="col-lg-9"> Level 1: 9 columns <div class="row"> <div class="col-lg-6"> Level 2: 6 columns </div> <div class="col-lg-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>.col-push-*</code> and <code>.col-pull-*</code> modifier classes.</p> <div class="row show-grid"> <div class="col-lg-9 col-push-3">9</div> <div class="col-lg-3 col-pull-9">3</div> </div> {% highlight html %} <div class="row show-grid"> <div class="col-lg-9 col-push-3">9</div> <div class="col-lg-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-basic">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 %} @grid-columns: 12; @grid-gutter-width: 30px; @grid-float-breakpoint: 768px; {% endhighlight %}
351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
<h4>Mixins</h4> <p>Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.</p> {% highlight css %} // 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 .clearfix(); } // 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 %} .wrapper { .make-row(); } .content-main { .make-column(8); } .content-secondary { .make-column(3); .make-column-offset(1); } {% endhighlight %} {% highlight html %} <div class="wrapper"> <div class="content-main">...</div> <div class="content-secondary">...</div> </div> {% endhighlight %} </div> <!-- Typography ================================================== --> <div class="bs-docs-section" id="type"> <div class="page-header"> <h1>Typography</h1> </div> <!-- Headings --> <h2 id="type-headings">Headings</h2> <p>All HTML headings, <code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code> are available.</p>
421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
<div class="bs-example bs-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> {% highlight html %} <h1>...</h1> <h2>...</h2> <h3>...</h3> <h4>...</h4> <h5>...</h5> <h6>...</h6> {% endhighlight %} <!-- Body copy --> <h2 id="type-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>1.428</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 computed line-height (10px by default).</p> <div class="bs-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 %} <p>...</p> {% endhighlight %} <!-- Body copy .lead --> <h3>Lead body copy</h3> <p>Make a paragraph stand out by adding <code>.lead</code>.</p> <div class="bs-example"> <p class="lead">Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.</p> </div> {% highlight html %} <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="type-emphasis">Emphasis</h2> <p>Make use of HTML's default emphasis tags with lightweight styles.</p>
491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
<h3>Small text</h3> <p>For de-emphasizing inline or blocks of text, use the <code>&lt;small&gt;</code> tag to set text at 85% the size of the parent. Heading elements receive their own <code>font-size</code> for nested <code>&lt;small&gt;</code> elements.</p> <div class="bs-example"> <p><small>This line of text is meant to be treated as fine print.</small></p> </div> {% highlight html %} <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-example"> <p>The following snippet of text is <strong>rendered as bold text</strong>.</p> </div> {% highlight html %} <strong>rendered as bold text</strong> {% endhighlight %} <h3>Italics</h3> <p>For emphasizing a snippet of text with italics.</p> <div class="bs-example"> <p>The following snippet of text is <em>rendered as italicized text</em>.</p> </div> {% highlight html %} <em>rendered as italicized text</em> {% endhighlight %} <div class="bs-callout bs-callout-info"> <h4>Alternate elements</h4> <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> </div> <h3>Alignment classes</h3> <p>Easily realign text to components with text alignment classes.</p> <div class="bs-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 %} <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-example"> <p class="text-muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p> <p class="text-primary">Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p> <p class="text-danger">Donec ullamcorper nulla non metus auctor fringilla.</p> <p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p> <p class="text-info">Maecenas sed diam eget risus varius blandit sit amet non magna.</p> </div> {% highlight html %} <p class="text-muted">...</p> <p class="text-primary">...</p> <p class="text-warning">...</p> <p class="text-danger">...</p> <p class="text-success">...</p> <p class="text-info">...</p> {% endhighlight %} <!-- Abbreviations --> <h2 id="type-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>
561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
<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-example"> <p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p> </div> {% highlight html %} <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-example"> <p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr> is the best thing since sliced bread.</p> </div> {% highlight html %} <abbr title="HyperText Markup Language" class="initialism">HTML</abbr> {% endhighlight %} <!-- Addresses --> <h2 id="type-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-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 %} <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="type-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-example"> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> </blockquote> </div> {% highlight html %} <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>
631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
<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-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 %} <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> {% endhighlight %} <h4>Alternate displays</h4> <p>Use <code>.pull-right</code> for a floated, right-aligned blockquote.</p> <div class="bs-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 %} <blockquote class="pull-right"> ... </blockquote> {% endhighlight %} <!-- Lists --> <h2 id="type-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-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 %} <ul> <li>...</li> </ul> {% endhighlight %} <h3>Ordered</h3> <p>A list of items in which the order <em>does</em> explicitly matter.</p> <div class="bs-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>
701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
<li>Aenean sit amet erat nunc</li> <li>Eget porttitor lorem</li> </ol> </div> {% highlight html %} <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-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 %} <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-example"> <ul class="list-inline"> <li>Lorem ipsum</li> <li>Phasellus iaculis</li> <li>Nulla volutpat</li> </ul> </div> {% highlight html %} <ul class="list-inline"> <li>...</li> </ul> {% endhighlight %} <h3>Description</h3> <p>A list of terms with their associated descriptions.</p> <div class="bs-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> <dt>Malesuada porta</dt> <dd>Etiam porta sem malesuada magna mollis euismod.</dd> </dl> </div> {% highlight html %} <dl> <dt>...</dt> <dd>...</dd> </dl>