All Bootstrap elements test page. Source.
Rules
Use the technique of Mobile First to creat the pages and components. Always start with the classes relates do the smaller screens, Example
Right
Wrong
Always start writting the grid elements. Avoid mix elements with grid classes and other component classes Start using elements already created on bootstrap instead create new ones Use the .col-xs-12.col-md-6
.col-md-6.col-xs-12
.col-xs-12.col-lg-6.col-md-4
grid
classes to orders and change the orders of the elements, but avoid too many changes in the same page.
Colors
Just add the class To avoid conflict with some pre existent Avoid change backgrounds to this colors, they should be used only for main actions and elements of a page. The most important elements that can need this colors already exist on the styleguide, like buttons, labels, progress bars and panels.Darker colors
Background primary
Background success
Background info
Background warning
Background danger
How to use
bg-XXX
to the element.background-color
just add another div
with the class.When to use
Grid
To see the grid, use the class Always, check if has a If you need split columns, add a new Use the mobile first aproach, to create pages and to organize the order of classses in HTML. All elements and components should be inserted inside a Grid System
.col-xs-12
.col-xs-6
.col-xs-3
.col-xs-3
.col-xs-3
.col-xs-3
.col-xs-3
.col-xs-3
How to use
.show-grid
on the body
tag or on the area that you wanna check.container
with a row
and col-XXX-nr
.row
.When to use
col-XXX-nr
Typography
Add the tag To add subtitle or helper text, add a The tag can be a Try to use only one For main titles of the page, prefer to use the component Page Header text lead, with bigger font. The following snippet of text is the default paragraph. The following snippet of text is the default paragraph with a link. The following snippet of text is hilighted. The following snippet of text is The following snippet of text is The following snippet of text is inserted. The following snippet of text is underlined. The following snippet of text is small. The following snippet of text is bold. The following snippet of text is italic. The following snippet of text is abbreviation. The following snippet of text has a smaller text on start. The following snippet of text is a code The following snippet of text is a keyboard instruction cd. Just add regular HTML texts tags Avoid create exceptions and custom All the texts shopuld be insertd inside For every text, prefer to use the regular elements and default texts. Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh. Nullam id dolor id nibh ultricies vehicula ut id elit. Etiam porta sem malesuada magna mollis euismod. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula. Text white Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Just add the class To avoid conflict with some pre existent Use this colors to highlight some information, or giv feedback to the user. The most important elements that can need this colors already exist on the styleguide, like error messages, titles, input label states and alert texts. Lowercased text. Uppercased text. Capitalized text. Add the proper classes to the text tag. Avoid add on parent elements, like add in the To avoid conflict with some pre existent No specif rule, just try to avoid the default text styles of components. Just small snippet of code, no specic rule Try do add this for any address reference, for better SEO. this need a caret Just add a This is part od this needs a close button on right side
Add the snoped of code, as it is. Use buttons for close Use icons always in standlone elements, never mix icons with other classes Left aligned text. Center aligned text. Right aligned text. Justified text. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe asperiores, quibusdam voluptatem nihil numquam esse ratione laborum ad, voluptatibus dolore earum molestiae optio eveniet unde. Quia doloribus vero libero nam. No wrap text. Just add the classes to components, but do not mix this with This classes are fot text only, no specific rules. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. Just add the components, with tle optional class to the right alignment, but do not mix this with This classes are fot text only, no specific rules. Jus add plain Check the type of contet, if is unordered list, when the order of the elements don't matter. Jus add plain Check the type of contet, if is ordered list, when the order of the elements matter. Jus add plain Dont mix the Choose the Jus add plain Dont mix the Choose the Jus add plain Choose the Header with tags or classes
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
How to use
heading
with the right font-size
or add the class hXX
.small
tag inside the heading elementheading
or any other element.When to use
h1
for each page. If you need visually more than one, use the class in other level of headingExamples body text
deleted.Strikethrough.<section>
.How to use
css styles
fo texts text tags
.When to use
Emphasis classes / text colors
How to use
text-XXX
to the element.text-color
just add another div
with the class.When to use
Transformation text classes
Main title with uppercase text
How to use
panel
element, instead of the content of panel
cont-style
, add a extra span
with the right class.When to use
Addresses
How to use
When to use
Carets / triangle
How to use
span
with the caret
class.When to use
dropdown
elements.Close button
How to use
When to use
alerts
and modals
Icons
How to use
When to use
Alignment classes
How to use
columns
.When to use
Blockquotes
columns
.When to use
Lists
Unordered
How to use
ul
markupWhen to use
Ordered
How to use
ol
markupWhen to use
Unstyled
How to use
ol
or ul
markuplist-inline
with list-unstyled
.When to use
ul
or ol
based on the content, and if the layout requires, or the bullets and numbers are not needed, use the unstyled style.Inline
How to use
ol
or ul
markuplist-inline
with list-unstyled
.When to use
ul
or ol
based on the content, and if the layout requires, or the bullets and numbers are not needed, use the inline style.Definition lists
How to use
definition list
markup with the optional class for horizontal layout.When to use
dl
if you have a list with scrict titles and descriptions. Add the horizontal layout to make more eradable.
Tables
Write basic markup, and try to use the elements Use tables for what they are intented to, tabular data, or, organized data, with titles, and coparision of rows Same as basic table, but with an extra class for better visualization of rows. Same as basic table. Same as basic table, but with an extra class for better visualization if mixed with other components in same page. Same as basic table. Same as basic table, but with an extra class for better visualization when interacting with the content of the table. We can add this behavior/class along with other classes, like class for striped rows. Same as basic table, plus if we have too many rows, too many columns or need compare data. Same as basic table, but with an extra class for some lines, based on states classes. Same as basic table, with some rows with colors, based on state of the data, present or not in the table, for example, with an extra column "completed" or just the color, instead the text. Same as basic table, but with an extra class for small table. Use if you ahve a small table as part of other component, like detail, not if the table ins the main content of the page. Same as basic table, but with an extra class for small screens. This class just add horizontal scroll to the table on mobile devices. Add this behavior if the table as too many columns, or if the content of some column as too many text.Basic table
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
How to use
caption
with a short description of the table and thead
, tbody
, th
and td
for separation of header and content.When to use
Table with striped rows
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
How to use
When to use
Table with borders
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
How to use
When to use
Table with hover in rows
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
How to use
When to use
Table with colors in rows
#
Column heading
Column heading
Column heading
1
Column content
Column content
Column content
2
Column content
Column content
Column content
3
Column content
Column content
Column content
4
Column content
Column content
Column content
5
Column content
Column content
Column content
6
Column content
Column content
Column content
7
Column content
Column content
Column content
How to use
When to use
Table with small rows
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
How to use
When to use
Table responsive
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
How to use
When to use
Forms
Use the default property Use the default property Add the class Use the Use the The input states are emant to give feedback to the user: Add the class Use always the default size, change to bigger or smaller if the main action of the page is not a single form. Use small Use large Add a Use the add on as helper to teh user, with something that can be part of the value, but dont need to be filled, because its a default value, like a currency symbol, default cents of a price, or country phone code. Avoid to use the add on as a Vertical forms should be used for long forms, when the form is the main action of the page. Prefer to write forms with the grid system. Add the class Use for small forms, with one or two fields. Prefer to write forms with the grid system. Add the class Same use as the default form, but limited to the sise of the label of the field. Prefer to write forms with the grid system. Write thre grid first, and after this insert in each row the proper label or field. Best aproach in most of the cases, because has betetr control in the small screens, better than juns stack / use the vertical form.Inputs states
How to use
autofocus
to set the initial focus to some field.disabled
to set disable some field.has-STATE
to the form-group
elelemnt, and the field and labels will follow the colors of the state.When to use
autofocus
if the main purpose of the screen is fill the field.disabled
if we need to show to the user that some information is not changeable. If some information is not possible to change and the user dont need to know that, hide the information instead of show as non editable.
Inputs sizes
How to use
input-SIZE
to the input
element.When to use
input-sm
if the form ins inside another element, like a table.input-lg
if you have a form with few fields or inside a container with higher priority, like a modal.Inputs group addons
How to use
span
with the class input-group-addon
just before or after the field.When to use
label
of the field.Basic vertical form
How to use
form-group
blocks without grid are displayed stacked, with vertical layoutWhen to use
Basic inline form
How to use
form-inline
in the form
element to display form-groups
aligned horizontally, as text, without label.When to use
Basic horizontal form
How to use
form-horizontal
in the form
element to display form-groups
as rows, with the label aligned to the field, on left side.When to use
Form with grid
How to use
When to use
Buttons
Use the button classes Choose the right state for the action, generally: add the Use for disabed buttons, when the action is disable, like, after the user already press the button, or need to fill some field before Create a button group with two links with the Use whe the user has to choose the sub action, for example a "Delete" button, with subaction "Delete all" and "Delete this". Avoid mix diferent types of actions inside the same dropdoww, like "Save" and "Delete". Avoid to use the dropdow as a menu. Add the size button class with the button state classes Prefer to use the default size, change the size to follow the size of the form, with the same rules as the input sizes. Add the This classe works well when you yse buttons inside cols of the grid Use with the grid to controll better how the button is displayed in slall screens or if yopu need large buttons in bigger screens too. Wrap regular buttons inside a element with Use to create groups of buttons with similar behavior, like pagination, or texts controls (bold / italic) Same as Button Group with an extra class Use to make a Wrap a set of You can add a Use when you have to group other groups of Wrap the buttons inside a Group buttons and actions with similar actions, stacked to fit the layout, or only for small screens.Buttons default
How to use
btn btn-STATE
to set thebutton appearance to button
, linka a
, or other elements like div
or span.When to use
Buttons disabled
How to use
disabled
class to any button-STATE
to show the light version/.When to use
Buttons dropdowns
How to use
btn btn-STATE
class, followed by a list with dropdown-menu
.When to use
Buttons sizes
How to use
btn btn-STATE btnSIZE
.When to use
Block buttons
How to use
btn-block
class to force the button to behave like a block, using the full width.When to use
Button Group
How to use
btn-group
.When to use
Button Group Justified
How to use
btn-group-justified
.When to use
btn-group
use the full width, to make the actions more visible.Button toolbar
How to use
btn-group
indide a element with the class btn-toolbar
.dropdown too.
When to use
btn-group
with related actions, for example, group two lists of actiosn related to soem etxt editor, firs with bold, italic, and other with align left, align center and align right. Button group vertical
How to use
btn-group-vertical
element.When to use
Images
add the class The appearance is changed only by the rounded or with border, the classes dont change the size, so we can use class No spoecific rules.Images
Image shapes
Rounded
Circle
Thumbnail
How to use
img-rounded
, img-circle
or img-thumbnail
to the image tag.img-thumbnail
to apply border in a large image.When to use
Position
Just add the classes to components, but do not mix this with Dont use to fload a position a column. This classes are fot blocks only, no specific rules. 3 divs bellow, two hidden, one visible Add the class Use show/hidden to make elements lvisible/unvisible to the user, only if the element visibility can be toggled without reload. If the element never will be visible, the element should be not present on the HTML. With the class Use to hide something, like a menu, to teh regular users, and add a shortuct or message to the users using screen readers. With the class use to hide image descriptions, like in logos. To show some element only for one screen size, use the classes To hide some element only for one screen size, use the classes For both types of classes, you can choose the display type, with the last part of the class name, using
The same behavior works for hide/print with the Drop
Visible as block on small screens only Visible as block on big screens Visible as inline on small screens only Visible as inline on big screens Visible as block for print only Add the class You can use this classes just to show/hide some element like a banner that should be visible only on mobile, for example, or duplicate content, with diffent layouts based on screel size, for example:Floats
Not the text!
How to use
columns
.When to use
Show and Hide elements
Visible / Invisible elements
.show
.hidden
.invisible
« Something invisible here!
How to use
show
, hidden
or invisible
to the element. invisible
class change the visibility, not the display
type, so the element still using space on the screen.When to use
Visible only to screen readers
How to use
sr-only
you can make shortcuts for screenreaders.When to use
Image replacement
How to use
text-hide
you can hide texts inside elements and keep the images or other elements.When to use
Responsive and Print classes
Classes to hide/show based on screen size
.visible-XX-
.hidden-XX-
.visible--block
.visible--inline
.visible-*-inline-block
.visible-print-block
.visible-print-inline
.visible-print-inline-block
How to use
visible-SIZE-DISPLAY
to the element to hide in a specifi screen size.When to use
Dropdown
Inside a To change the direction of open submenu, wrap with the class You can add a list header, inside the list You can add a list divider, inside the list Use dropdows to create navigations grouped, like in Buttons dropdowns.
How to use
dropdown
wrapper, add a button (with a caret span inside), followed by a list with dropdown-menu
class. dropup
.dropdown-menu
, adding the class dropdown-header
to the list element.dropdown-menu
, adding the class divider
to the list element.When to use
Navigation
Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui. Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Create a list with the class Avoid create too many tabs, because they are not responsive, and break line in small screens You can use responsive visible classes to show the navigation as tabs on bigger screens and as Create a list with the class Use to create a navigation like tabs, but without the behavior of tabs, with hidden elements with content. You can use responsive visible classes to show the navigation as pills on bigger screens and as Create a list with the class Use to create a navigation like tabs, but without the behavior of tabs, with hidden elements with content. You can use responsive visible classes to show the navigation as pills stacked on bigger screens and as Add the Use the Add the Use in top o footer of the page, or both, with the main links and submenus Just create a list with the The last item, to the current page should be a plain text. Add in all the pages, with the site map to teh current page. Add a simple list with the Try ti display pagination in top and footer of the lists, if the list is bigger than the size on screen. Add a list with the Try to use pagination with numbers, or the pagination plain, only with the links if not possible. Add span element with the classes Avoid mix the label classes with other classes. Use to display small texts, informing the user about the state or counting of some item. Add span element with the class Avoid mix the label classes with other classes. Use to display small texts or numbers, informing the user about the state or counting of some item. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium in quo non libero quod autem dolor atque provident, necessitatibus expedita. Nam ipsam incidunt ut minus molestiae inventore blanditiis, quaerat ab? Use snimet of code aside, and change the content. Donr change the headings, for better appearance. Use to create page or section headers, one per gape or section. Use a title with the Use to create page or section headers. The example is a simple use case of different components together, using the grid. No specific rule. Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Add the You can add button to close, with the markup and the class To add titles, add the headings or use the element Use to give feedback to the user, about an action. Avoid use as simple box, with form or any other content inside. Add a element To show the value of the bar, add the text inside the codw progress-bar. To animate the Use The Use to show progress of some complex operation, like multiple page form, or duration of some operation.Tabs
How to use
nav nav-tabs
with links to panel tab IDs.When to use
collapse
in small screens.Pills Horizontal
How to use
nav nav-pills
.When to use
collapse
or Pills vertical in small screens.Pills vertical
How to use
nav nav-pills nav-stacked
.When to use
collapse
in small screens.Navbar
Default Navbar and Inverse navbar
How to use
navbar
class wrapper, and the content elements inside. navbar-toggle collapsed
to create the button to open the menu in small screens.navbar-inverse
to change the color.When to use
Breadcrumbs
How to use
breadcrumb
.When to use
Pagination
How to use
pagination class
and the class for size pagination-SIZE
or style pagination-STYLE
.When to use
Pager
How to use
pager
class. To add the arrows, use the previous
or next
classes to the list item.When to use
Indicators
Labels
How to use
label label-STATE
.When to use
Badges
How to use
badge
.When to use
Jumbotron
Hello, world!
How to use
When to use
Page header
Default page header
Example page header Subtext for header
How to use
page-header
wrapper.When to use
Custom elements
How to use
When to use
Alerts
Warning!
How to use
alert
to the wrapper element, with the style class, alert-STYLE
alert-dismissible
on the wrapper element.strong
.When to use
Progress bars
Basic
With label
Animated
Stacked
Contextual alternatives
Striped
How to use
progress-bar
wiyth a inline width, inside a a progress wrapper
.progress-bar
add the class progress-striped
to the wrapper.progress-bar-STATE
to change the color os the bars.progress
accepst multiple bars inside, use diferent colors, like progress-STYLE
do make visible, and care with the order of elements to make all visible.When to use
Media object
Add the wrapper No specific rule Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Add the wrapper No specific ruleDefault
Media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Media heading
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
How to use
media
with the content, and the right classes to position the media/imageWhen to use
Media alignment
Top aligned media
Middle aligned media
Bottom aligned media
How to use
media
with the content, and the right classes to position the media/imageWhen to use
Containers
Add the Use for show lists with states for itens Add the Use to display links as a stacked list, like menus, with or without states Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit. Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit. Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit. Like the regular The same as List groups
How to use
list-group
to the ul
element and list-group-item
to each list item elementWhen to use
List groups links
How to use
list-group
to the div
element and list-group-item
to each link.When to use
List groups content
List group item heading
List group item heading
List group item heading
How to use
list-group
, but with complex content.When to use
list-group
, but avoid content too large inside.
Panels
Add the class Use to cerate areas of content, avoid add states to panels, of the content is too big, like a form. Avoid stacked panels. Add the class Use to cerate areas of content, avoid add states to panels, of the content is too big, like a form.Basic
Panel heading with strong title
How to use
When to use
panel panel-default
to the div, and the elements panel-heading
, panel-footer
, optionals, and panel-body
.When to use
With content
Panel with table
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
Panel with list group
How to use
When to use
Panels with states
Panel primary
Panel success
Panel warning
Panel danger
Panel info
How to use
panel panel-STATE
to the div, and the elements panel-heading
, optional, and panel-body
.When to use
Wells
Just add the Use to display any static information to the user. Avoid add too many content inside, like forms. Try to use as information box only, like the alerts.Well sizes
How to use
well
class the element.When to use
Dialogs
Copy the code snippet aside, check if has the corrects IDs and buttons to close. Use the areas with the right content, titles, body and footer for actions and buttons. Use modals to show adtional informations, confirm actions Avoid use modals to display forms or any main task to the user. Add the property Use to display tiny informations and feedbacks to the user. The information of tooltips sjould not be required to complete any task.Modals
How to use
When to use
Popovers
How to use
When to use
Tooltips
How to use
data-toggle="tooltip"
to any element and the properties, optional, data-placement
and data-original-title
.When to use
Collapse
Add the property Use to display extra information, like the toltips. Avoid use collapsible elements mandatory to complete some action. Use as external controller to Add the Use the code snipet Use for information and fors splited by steps or groups of type of information, when is mandatory show only one step at each time. You can use the Simple collapsible element
How to use
data-toggle="collapse"
to the link, with the href
or data-target=
with the ID of the collapsible element.When to use
collapse
.Accordeon
How to use
panel
wrapper with the panel-heading
and panel-collapse
and add the unique IDs.When to use
collapse
as a small screen alternative to the regular tabs
navigation.
Carousel
Copy the example of code, above. You can use as full row in your page or inside a smaller column. Add a Use images with the right size, avoid strech images.How to use
container
inside the content of slides and wrap the carousel-control
if necessary.When to use
Dont use..