base-css.html 66.01 KiB
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Base · Twitter Bootstrap</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Le styles -->
    <link href="assets/css/bootstrap.css" rel="stylesheet">
    <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="assets/css/docs.css" rel="stylesheet">
    <link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
  </head>
  <body data-spy="scroll" data-target=".subnav" data-offset="50">
  <!-- Navbar
    ================================================== -->
    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button"class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="./index.html">Bootstrap</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="">
                <a href="./index.html">Overview</a>
              </li>
              <li class="">
                <a href="./scaffolding.html">Scaffolding</a>
              </li>
              <li class="active">
                <a href="./base-css.html">Base CSS</a>
              </li>
              <li class="">
                <a href="./components.html">Components</a>
              </li>
              <li class="">
                <a href="./javascript.html">Javascript plugins</a>
              </li>
              <li class="">
                <a href="./less.html">Using LESS</a>
              </li>
              <li class="divider-vertical"></li>
              <li class="">
                <a href="./download.html">Customize</a>
              </li>
              <li class="">
                <a href="./examples.html">Examples</a>
              </li>
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
</ul> </div> </div> </div> </div> <div class="container"> <!-- Masthead ================================================== --> <header class="jumbotron subhead" id="overview"> <h1>Base CSS</h1> <p class="lead">On top of the scaffolding, basic HTML elements are styled and enhanced with extensible classes to provide a fresh, consistent look and feel.</p> <div class="subnav"> <ul class="nav nav-pills"> <li><a href="#typography">Typography</a></li> <li><a href="#code">Code</a></li> <li><a href="#tables">Tables</a></li> <li><a href="#forms">Forms</a></li> <li><a href="#buttons">Buttons</a></li> <li><a href="#icons">Icons by Glyphicons</a></li> </ul> </div> </header> <!-- Typography ================================================== --> <section id="typography"> <div class="page-header"> <h1>Typography <small>Headings, paragraphs, lists, and other inline type elements</small></h1> </div> <h2>Headings &amp; body copy</h2> <!-- Headings & Paragraph Copy --> <div class="row"> <div class="span4"> <h3>Typographic scale</h3> <p>The entire typographic grid is based on two Less variables in our variables.less file: <code>@baseFontSize</code> and <code>@baseLineHeight</code>. The first is the base font-size used throughout and the second is the base line-height.</p> <p>We use those variables, and some math, to create the margins, paddings, and line-heights of all our type and more.</p> </div> <div class="span4"> <h3>Example body text</h3> <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> <h3>Lead body copy</h3> <p>Make a paragraph stand out by adding <code>.lead</code>.</p> <p class="lead">Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.</p> </div> <div class="span4"> <div class="well"> <h1>h1. Heading 1</h1> <h2>h2. Heading 2</h2> <h3>h3. Heading 3</h3> <h4>h4. Heading 4</h4> <h5>h5. Heading 5</h5> <h6>h6. Heading 6</h6> </div> </div> </div> <!-- Misc Elements --> <h2>Emphasis, address, and abbreviation</h2> <table class="table table-bordered table-striped"> <thead> <tr> <th>Element</th> <th>Usage</th> <th>Optional</th> </tr>
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
</thead> <tbody> <tr> <td> <code>&lt;strong&gt;</code> </td> <td> For emphasizing a snippet of text with <strong>important</strong> </td> <td> <span class="muted">None</span> </td> </tr> <tr> <td> <code>&lt;em&gt;</code> </td> <td> For emphasizing a snippet of text with <em>stress</em> </td> <td> <span class="muted">None</span> </td> </tr> <tr> <td> <code>&lt;abbr&gt;</code> </td> <td> Wraps abbreviations and acronyms to show the expanded version on hover </td> <td> <p>Include optional <code>title</code> attribute for expanded text</p> Use <code>.initialism</code> class for uppercase abbreviations. </td> </tr> <tr> <td> <code>&lt;address&gt;</code> </td> <td> For contact information for its nearest ancestor or the entire body of work </td> <td> Preserve formatting by ending all lines with <code>&lt;br&gt;</code> </td> </tr> </tbody> </table> <div class="row"> <div class="span4"> <h3>Using emphasis</h3> <p><a href="#">Fusce dapibus</a>, <strong>tellus ac cursus commodo</strong>, <em>tortor mauris condimentum nibh</em>, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.</p> <p><strong>Note:</strong> Feel free to use <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> in HTML5, but their usage has changed a bit. <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> <div class="span4"> <h3>Example addresses</h3> <p>Here are two examples of how the <code>&lt;address&gt;</code> tag can be used:</p> <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@gmail.com</a> </address> </div>
211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
<div class="span4"> <h3>Example abbreviations</h3> <p>Abbreviations with a <code>title</code> attribute have a light dotted bottom border and a help cursor on hover. This gives users extra indication something will be shown on hover.</p> <p>Add the <code>initialism</code> class to an abbreviation to increase typographic harmony by giving it a slightly smaller text size.</p> <p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr> is the best thing since sliced bread.</p> <p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p> </div> </div> <!-- Blockquotes --> <h2>Blockquotes</h2> <table class="table table-bordered table-striped"> <thead> <tr> <th>Element</th> <th>Usage</th> <th>Optional</th> </tr> </thead> <tbody> <tr> <td> <code>&lt;blockquote&gt;</code> </td> <td> Block-level element for quoting content from another source </td> <td> <p>Add <code>cite</code> attribute for source URL</p> Use <code>.pull-left</code> and <code>.pull-right</code> classes for floated options </td> </tr> <tr> <td> <code>&lt;small&gt;</code> </td> <td> Optional element for adding a user-facing citation, typically an author with title of work </td> <td> Place the <code>&lt;cite&gt;</code> around the title or name of source </td> </tr> </tbody> </table> <div class="row"> <div class="span4"> <p>To include a blockquote, 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> <p>Include an optional <code>&lt;small&gt;</code> element to cite your source and you'll get an em dash <code>&amp;mdash;</code> before it for styling purposes.</p> </div> <div class="span8"> <pre class="prettyprint linenums"> &lt;blockquote&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.&lt;/p&gt; &lt;small&gt;Someone famous&lt;/small&gt; &lt;/blockquote&gt; </pre> </div> </div><!--/row--> <h3>Example blockquotes</h3> <div class="row"> <div class="span6"> <p>Default blockquotes are styled as such:</p> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p> <small>Someone famous in <cite title="">Body of work</cite></small> </blockquote> </div>
281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
<div class="span6"> <p>To float your blockquote to the right, add <code>class="pull-right"</code>:</p> <blockquote class="pull-right"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p> <small>Someone famous in <cite title="">Body of work</cite></small> </blockquote> </div> </div> <!-- Lists --> <h2>Lists</h2> <div class="row"> <div class="span4"> <h3>Unordered</h3> <p><code>&lt;ul&gt;</code></p> <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> <div class="span4"> <h3>Unstyled</h3> <p><code>&lt;ul class="unstyled"&gt;</code></p> <ul class="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> <div class="span4"> <h3>Ordered</h3> <p><code>&lt;ol&gt;</code></p> <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> </div><!-- /row -->
351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
<br> <div class="row"> <div class="span4"> <h3>Description</h3> <p><code>&lt;dl&gt;</code></p> <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> <div class="span8"> <h3>Horizontal description</h3> <p><code>&lt;dl class="dl-horizontal"&gt;</code></p> <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> <hr> <p> <span class="label label-info">Heads up!</span> 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> </div><!-- /row --> </section> <!-- Code ================================================== --> <section id="code"> <div class="page-header"> <h1>Code <small>Inline and block code snippets</small></h1> </div> <div class="row"> <div class="span4"> <h2>Inline</h2> <p>Wrap inline snippets of code with <code>&lt;code&gt;</code>.</p> <pre class="prettyprint linenums"> For example, &lt;code&gt;section&lt;/code&gt; should be wrapped as inline. </pre> </div><!--/span--> <div class="span4"> <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> <pre> &lt;p&gt;Sample text here...&lt;/p&gt; </pre> <pre class="prettyprint linenums" style="margin-bottom: 9px;"> &lt;pre&gt; &amp;lt;p&amp;gt;Sample text here...&amp;lt;/p&amp;gt; &lt;/pre&gt; </pre> <p><strong>Note:</strong> Be sure to keep code within <code>&lt;pre&gt;</code> tags as close to the left as possible; it will render all tabs.</p> <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><!--/span--> <div class="span4"> <h2>Google Prettify</h2>