From 648c4689273647c321dd6e3979d910282e9a9339 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 26 Oct 2011 23:11:56 -0700 Subject: breaking down the main page into subpages for easier, more comprehensive documentation --- docs/base-css.html | 885 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 885 insertions(+) create mode 100644 docs/base-css.html (limited to 'docs/base-css.html') diff --git a/docs/base-css.html b/docs/base-css.html new file mode 100644 index 000000000..e3b3782c0 --- /dev/null +++ b/docs/base-css.html @@ -0,0 +1,885 @@ + + + + + Bootstrap, from Twitter + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Base CSS

+

The core typography, form, and table styles of Bootstrap

+
+ + + +
+ + +

Headings & body copy

+ + +
+
+

Typographic scale

+

The entire typographic grid is based on two Less variables in our preboot.less file: @baseFontSize and @baseLineHeight. The first is the base font-size used throughout and the second is the base line-height.

+

We use those variables, and some math, to create the margins, paddings, and line-heights of all our type and more.

+
+
+

Example body text

+

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 ut id elit.

+

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec sed odio dui.

+
+
+
+

h1. Heading 1

+

h2. Heading 2

+

h3. Heading 3

+

h4. Heading 4

+
h5. Heading 5
+
h6. Heading 6
+
+
+
+ + +

Emphasis, address, and abbreviation

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ElementDescriptionUsage
+ <strong> + + For emphasizing a snippet of text with important + + None +
+ <em> + + For emphasizing a snippet of text with stress + + None +
+ <abbr> + + Wraps abbreviations and acronyms to show the expanded version on hover + + Include optional title for expanded text +
+ <address> + + For contact information for its nearest ancestor or the entire body of work + + Preserve formatting by ending all lines with <br> +
+ +
+
+

Using emphasis

+

Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.

+

Note: Feel free to use <b> and <i> in HTML5, but their usage has changed a bit. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.

+
+
+

Example addresses

+

Here are two examples of how the <address> tag can be used:

+
+ Twitter, Inc.
+ 795 Folsom Ave, Suite 600
+ San Francisco, CA 94107
+ P: (123) 456-7890 +
+
+ Full Name
+ first.last@gmail.com +
+
+
+

Example abbreviations

+

Abbreviations are styled with uppercase text and a light dotted bottom border. They also have a help cursor on hover so users have extra indication something will be shown on hover.

+

HTML is the best thing since sliced bread.

+

An abbreviation of the word attribute is attr.

+
+
+ + + +

Blockquotes

+
+
+

To include a blockquote, wrap <blockquote> around <p> and <small> tags. Use the <small> element to cite your source and you'll get an em dash &mdash; before it.

+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

+ Someone famous +
+
+
+
+<blockquote>
+  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>
+  <small>Dr. Julius Hibbert</small>
+</blockquote>
+
+
+
+ + +

Lists

+
+
+

Unordered <ul>

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

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

Ordered <ol>

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

Description <dl>

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

Code Inline and block

+ + + + + + + + + + + + + + + + + + + + + +
ElementResult
<code>In a line of text like this, your wrapped code will look like this <html> element.
<pre> +
<div>
+  <h1>Heading</h1>
+  <p>Something right here...</p>
+</div>
+

Note: Be sure to keep code within pre tags as close to the left as possible; it will render all tabs.

+
<pre class="prettyprint"> +

Using the google-code-prettify library, you're blocks of code get a slightly different visual style and automatic syntax highlighting. You can also add an additional class to add line numbers.

+
<div>
+  <h1>Heading</h1>
+  <p>Something right here...</p>
+</div>
+
<div>
+  <h1>Heading</h1>
+  <p>Something right here...</p>
+</div>
+

Download google-code-prettify and view the readme for how to use.

+
+ + +

Inline labels for special attention

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LabelsMarkup
+ Default + + <span class="label">Default</span> +
+ New + + <span class="label success">New</span> +
+ Warning + + <span class="label warning">Warning</span> +
+ Important + + <span class="label important">Important</span> +
+ Notice + + <span class="label notice">Notice</span> +
+ +
+ + + + +
+ + +

Table markup

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

Example tables

+

1. Default table styles

+

All tables will be automatically styled with only the essential borders to ensure readability and maintain structure. No need to add extra classes or attributes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameLanguage
1SomeOneEnglish
2JoeSixpackEnglish
3StuDentCode
+
+<table>
+  ...
+</table>
+

2. Zebra-striped

+

Get a little fancy with your tables by adding zebra-striping—just add the .zebra-striped class.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameLanguage
1SomeOneEnglish
2JoeSixpackEnglish
3StuDentCode
+

Note: Zebra-striping is a progressive enhancement not available for older browsers like IE8 and below.

+
+<table class="zebra-striped">
+...
+</table>
+

3. Zebra-striped w/ TableSorter.js

+

Taking the previous example, we improve the usefulness of our tables by providing sorting functionality via jQuery and the Tablesorter plugin. Click any column’s header to change the sort.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#First NameLast NameLanguage
1YourOneEnglish
2JoeSixpackEnglish
3StuDentCode
+
+<script src="js/jquery/jquery.tablesorter.min.js"></script>
+<script >
+  $(function() {
+    $("table#sortTableExample").tablesorter({ sortList: [[1,0]] });
+  });
+</script>
+<table class="zebra-striped">
+  ...
+</table>
+ +
+ + + + +
+ +
+
+

Four types of forms

+

With 2.0, we now have four types of forms to choose from:

+
    +
  • Search form for a super-rounded input and optional button
  • +
  • Inline form for a series of elements on one line
  • +
  • Horizontal form for left-aligned labels
  • +
  • Vertical form for stacked labels and inputs
  • +
+
+
+

+
+
+
+
+

Search form

+
+
+
+ +
+
+
+
+
+

Inline form

+
+
+
+
+

Some directional text

+

And maybe some kind of optional supporting text right here.

+ + + + +
+
+
+
+
+
+

Horizontal form

+
+
+
+ Example form +
+ +
+ +

Help text here. Be sure to fill this out like so, or else!

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ Example form +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + + +
+

Note: Labels surround all the options for much larger click areas and a more usable form.

+
+
+
+ +
+
+ + +
+

Note: Labels surround all the options for much larger click areas and a more usable form.

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

Vertical form

+
+
+
+ Example form +
+ +
+ +

Be sure to fill this out like so, or else!

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

Buttons

+

As a convention, buttons are used for actions while links are used for objects. For instance, "Download" could be a button and "recent activity" could be a link.

+

All buttons default to a light gray style, but a number of functional classes can be applied for different color styles. These classes include a blue .primary class, a light-blue .info class, a green .success class, and a red .danger class.

+
+
+

Example buttons

+

Button styles can be applied to anything with the .btn applied. Typically you’ll want to apply these to only <a>, <button>, and select <input> elements. Here’s how it looks:

+
+      +
+

Alternate sizes

+

Fancy larger or smaller buttons? Have at it!

+ + +

Disabled state

+

For buttons that are not active or are disabled by the app for one reason or another, use the disabled state. That’s .disabled for links and :disabled for <button> elements.

+

Links

+ +

Buttons

+
+   +
+
+
+ +
+
+

Button groups

+
+
+

Example

+
+
+ Left + Middle + Right +
+
+
+
+
+ 1 + 2 + 3 + 4 + 5 +
+
+ 6 + 7 + 8 +
+
+ 9 +
+
+ 10 +
+
+
+
+
+ +
+ + + + +
+ + + + + + + + + + + + + + -- cgit v1.2.3