Base CSS
Typography
Headings & body copy
h1. Heading 1
h2. Heading 2
h3. Heading 3
h4. Heading 4
h5. Heading 5
Header borders
You can add borders under any header by adding the .bordered
class.
Example body text
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut feugiat diam vitae enim semper ac cursus nunc consequat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus mattis facilisis eleifend. Nulla fringilla, neque ac egestas condimentum, massa sapien molestie magna, facilisis suscipit ipsum risus ut ligula. Mauris faucibus elit quis mauris egestas commodo consectetur turpis facilisis.
Preventing wrapping
Use the .nowrap
utility class when you want to keep content grouped together
on one line regardless of screen size or available width.
Adjust the screen size and watch the example below. The icon will stay grouped together with the text instead of being broken across multiple lines.
A lot of bad things might happen. Things are swell. Rut roh Shaggy. Now you've done it.
Emphasis, address and abbreviation
Element | Usage | Optional |
---|---|---|
<strong> |
For emphasizing a snippt of text with important | None |
<em> |
For emphasizing a snippt of text with stress | None |
<abbr> |
Wraps abbreviations and acronyms to show the expanded version on hover | Include the optional title attribute for expanded text. |
<address> |
For contact information for its nearest ancestor of the entire body of work | Preserve formatting by ending all lines with <br /> |
Using emphasis
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut feugiat diam vitae enim semper ac cursus nunc consequat.
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:
9721 Sherrill Blvd
Knoxville TN 37932
P: (123) 456-7890 Full Name
first.last@gmail.com
Example abbreviations
Abbreviations with a title
attribute have a light dotted
bottom border and a help cursor on hover. This gives users 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
Element | Usage | Optional |
---|---|---|
<blockquote> |
Block-level element for quoting content from another source |
Add a Use the |
<small> |
Optional element for adding a user-facing citation, typically an author with title of work | Place the <cite> around the title or name of source |
To include a blockquote, wrap <blockquote>
around any HTML as the quote.
For straight quotes we recommend a <p>
.
Include an optional <small>
element to cite your source and you'll get
an em dash —
before it for styling purposes.
<blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.</p> <small>Someone famous</small> </blockquote>
Example blockquotes
Default blockquotes are styled as such:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.
Someone famous in Body of work
To float your blockquote to the right, add class="pullRight"
:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.
Someone famous in Body of work
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 class="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>
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Integer molestie lorem at massa
- Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
- Faucibus porta lacus fringilla vel
- Aenean sit amet erat nunc
- Eget porttitor lorem
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
Wrap inline snippets of code with <code>
.
For example, <code>section</code> should be wrapped as inline.
Basic block
Use <pre>
for multiple lines of code. Be
sure to escape any angle brackets in the code for proper rendering.
<p>Sample text here...</p>
<pre> <p>Sample text here...</p> </pre>
Note: Be sure to keep code within <pre>
tags as close to the left as possible; it will render all tabs.
Google Prettify
Take the same <pre>
element and add two optional classes for enhanced rendering.
<p>Sample text here...</p>
<pre class="prettyprint linenums"> <p>Sample text here...</p> </pre>
Download google-code-prettify and view the readme for how to use.
Tables
Table markup
Tag | Description |
---|---|
<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>
Table options
Name | Class | Description |
---|---|---|
Default | None | No styles, just columns and rows |
Basic | .table |
Adds header styles and standard padding |
Alternating rows | .table-alternateRow |
Highlights a row with the alternate row color. Must be applied on the <tr> , not the <table> |
Bordered | .table-border |
Creates an outline around the outside of the table |
Column borders | .table-columnBorder |
Adds borders between the columns |
Row borders | .table-rowBorder |
Adds borders between the rows |
Example tables
1. Default table styles
Tables are automatically styled headers and padding.
<table class="table"> ... </table>
# | First Name | Last Name | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
2. Alternating rows
Add alternating rows by adding the .table-alternatingRow
class to the <table>
.
Note that this is not supported on IE8 due to lack of CSS selector support.
<table class="table table-alternatingRow"> ... <tbody> <tr>...</tr> <tr>...</tr> </tbody> </table>
# | First Name | Last Name | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
3. Bordered table
Add borders around the entire table and rounded corners for aesthetic purposes.
<table class="table table-border"> ... </table>
# | First Name | Last Name | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
4. Column borders
Add borders between columns with the .table-columnBorder
class.
<table class="table table-columnBorder"> ... </table>
# | First Name | Last Name | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
5. Row borders
Add borders between rows with the .table-rowBorder
class.
<table class="table table-rowBorder"> ... </table>
# | First Name | Last Name | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
6. Combine them all!
Feel free to combine any of the table classes to achieve different looks by utilizing any of the available classes.
<table class="table table-alternatingRow table-border table-columnBorder table-rowBorder"> ... <tbody> <tr>...</tr> <tr>...</tr> </tbody> </table>
# | First Name | Last Name | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird |
Forms
Control examples
All of the standard controls included in Bootstrap are displayed.
Structured forms
Additional markup is used to group controls, provide inline feedback and show validation styles for errors, warnings and success.
You can indicate a required field by just
adding the .required
class to the label
.
<form class="form"> <div class="form-group"> <label class="required">Text</label> <input class="input-large" type="text" /> </div> <div class="form-group"> <label>Drop down</label> <select class="input-medium"> <option>One</option> <option>Two</option> <option>Three</option> </select> </div> <div class="form-actions"> <input class="button button-primary" type="submit" value="Submit" /> </div> </form>
Custom appearances
Control states
Bootstrap features styles for browser-supported disabled
states and adds classes
for creating read-only inputs.
Control sizes
Inputs can be sized by using a set of pre-built classes like .input-mini
,
.input-medium
and .input-xlarge
.
Validation
Bootstrap also includes validation styles for errors, warnings and success. To use,
add the .error
class to the surrounding .form-group
.
Inline form groups
You can display form groups horizontally by adding the .inline
class.
TODO: Need to formalize the sizes for controls, taking into account this use case.
Icons
12 x 12
- icon12-closedRow
- icon12-expandedRow
- icon12-seekNext
- icon12-seekPrevious
- icon12-pause
- icon12-stop
- icon12-t
- icon12-t (disabled)
- icon12-pot
- icon12-pot (disabled)
- icon12-yield
- icon12-yield (disabled)
- icon12-next
- icon12-last
- icon12-first
- icon12-previous
- icon12-sortDown
- icon12-sortUp
- icon12-indexCard
- icon12-indexCard (disabled)
- icon12-tree-collapse
- icon12-tree-expand
- icon12-calendar-next
- icon12-calendar-back
- icon12-close
- icon12-plus
- icon12-plus2
- icon12-minus
- icon12-question
- icon12-info
- icon12-audio
- icon12-measuringCup
- icon12-measuringCup (disabled)
- icon12-facet-collapse
- icon12-facet-expand
16 x 16
- icon16-newWindow
- icon16-expand
- icon16-restore
- icon16-close
- icon16-filter
- icon16-zoomFill
- icon16-zoomOut
- icon16-zoomIn
- icon16-magnify
- icon16-magnifySmall
- icon16-view
- icon16-view2
- icon16-search
- icon16-home
- icon16-homeWhite
- icon16-calendarMonth
- icon16-calendarDay
- icon16-edit
- icon16-trash
- icon16-trash (disabled)
- icon16-print
- icon16-download
- icon16-check
- icon16-check (disabled)
- icon16-square
- icon16-squareFilled
- icon16-square-checked
- icon16-deliverableIncomplete
- icon16-deliverableComplete
- icon16-deliverableRejected
- icon16-deliverableReview
- icon16-deliverableUploaded
- icon16-deliverableNeedApproval
- icon16-deliverableError
- icon16-undo
- icon16-processing
- icon16-pending
- icon16-folder
- icon16-rejectOne
- icon16-videoAdd
- icon16-videosApprove
- icon16-videosDelete
- icon16-arrow4DiagOut
- icon16-arrow4DiagIn
- icon16-arrowNESW
- icon16-arrowEW
- icon16-arrow4
- icon16-arrowStopW
- icon16-arrowStopE
- icon16-resizeEW
- icon16-gripDiagSE
- icon16-cartAdd
- icon16-cartRemove
- icon16-commentAdd
- icon16-commentRemove
- icon16-contactAdd
- icon16-contactRemove
- icon16-tabAdd
- icon16-tabRemove
- icon16-pageAdd
- icon16-pageRemove
- icon16-userAdd
- icon16-userRemove
- icon16-userRemove (disabled)
- icon16-approve
- icon16-approve (disabled)
- icon16-scheduled
- icon16-reconcile
- icon16-comment
- icon16-new
- icon16-pin
- icon16-pin (disabled)
- icon16-mark
- icon16-mark (disabled)
- icon16-comment
- icon16-comment (disabled)
- icon16-server-down
- icon16-server-up
- icon16-acceptOne
- icon16-rejectAll
- icon16-videoRemove
- icon16-videosAdd
- icon16-gridLarge
- icon16-gripSmall
- icon16-tree
- icon16-list
- icon16-bullets
- icon16-layers
- icon16-hierarchy
- icon16-camera
- icon16-video
- icon16-picture
- icon16-email
- icon16-film
- icon16-filmFilled
- icon16-question
- icon16-info
- icon16-warning
- icon16-success
- icon16-error
- icon16-flag-orange
- icon16-flag-red
- icon16-flag-blue
- icon16-flag-green
- icon16-flag-purple
- icon16-showColLeft
- icon16-showColRight
- icon16-hideColLeft
- icon16-hideColRight
- icon16-msexcel
- icon16-flash
- icon16-msppoint
- icon16-msword
- icon16-txtdoc
- icon16-xml
- icon16-msvisio
- icon16-document
- icon16-ticket
- icon16-acceptAll
- icon16-videoApprove
- icon16-videoDelete
- icon16-videosRemove
Built as a sprite
Instead of making every icon an extra request, we've compiled them into a
sprite—a bunch of images in one file that uses CSS to position the images with
background-position
.
Icons are prefixed with .icon12-
for 12x12 icons and
.icon16-
for 16x16 icons for proper namespacing and scoping, much
like our other components. This will help avoid conflicts with other tools.
Initialization
Bootstrap uses an <i>
tag for all icons, but they have no case
class-only a shared prefix. To use, place the following code just about anywhere:
<i class="icon16-search"></i>
Disabled icons
For icons that support "disabled" appearances, simply add a .disabled
class to the icon.
<i class="icon12-pot disabled"></i>
Utility Classes
Hypertext
Usage and Initialization
Bootstrap also includes styles for Hyperlink. To remove the visited appearance from hyperlink, add the .action
class to the a
tag.
<a href="#">without action</a> <a class="action" href="#">with action</a>
Elements
Usage and Initialization
To hide the element,add the .hidden
class to the element.
<a href="javascript:void(0)" onclick='$(this).addClass("hidden")'>click to hide me</a>
Labels
Usage and Initialization
requiredFields
class is added to label associated with form field to indicate the form field as required field.
<div class="requiredFields">Required field</div>
Text
Usage and Initialization
Bootstrap provides .center
class to center the text of block element.
Text centered
<p class="center">Text centered</p>