Global CSS settings, fundamental HTML elements styled and enhanced with extensible classes, and an advanced grid system.
Overview
Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.
HTML5 doctype
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.
Mobile first
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, Bootstrap is mobile first. Mobile first styles can be found throughout the entire library instead of in separate files.
To ensure proper rendering and touch zooming, add the viewport meta tag to your <head>.
You can disable zooming capabilities on mobile devices by adding user-scalable=no to the viewport meta tag. This disables zooming, meaning users are only able to scroll, and results in your site feeling a bit more like a native application. Overall, we don't recommend this on every site, so use caution!
Typography and links
Bootstrap sets basic global display, typography, and link styles. Specifically, we:
Set background-color: #fff; on the body
Use the @font-family-base, @font-size-base, and @line-height-base attributes as our typographic base
Set the global link color via @link-color and apply link underlines only on :hover
These styles can be found within scaffolding.less.
Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects. Note that, due to padding and more, neither container is nestable.
Use .container for a responsive fixed width container.
Use .container-fluid for a full width container, spanning the entire width of your viewport.
Alignments
Classes to apply to elements contained within block-level elements with a relative display.
Combined Alignments
The content within a relatively displayed block element can be positioned in the following positions. The content must be wrapped within a div with the appropriate alignment class as shown in the examples below. Please remember that the classes ignore the parent container's padding.
Top Left
Center Left
Bottom Left
Top Center
Center Center
Bottom Center
Top Right
Center Right
Bottom Right
Vertical Alignment
To simply align an element vertically, centering it from top to bottom of its container, use the .align-vertical-center class.
This is centered vertically only.
Buttons
Button tags
Use the button classes on an <a>, <button>, or <input> element.
Context-specific usage
While button classes can be used on <a> and <button> elements, only <button> elements are supported within our nav and navbar components.
Links acting as buttons
If the <a> elements are used to act as buttons – triggering in-page functionality, rather than navigating to another document or section within the current page – they should also be given an appropriate role="button".
Cross-browser rendering
As a best practice, we highly recommend using the <button> element whenever possible to ensure matching cross-browser rendering.
Among other things, there's a bug in Firefox <30 that prevents us from setting the line-height of <input>-based buttons, causing them to not exactly match the height of other buttons on Firefox.
Styling options
Use any of the available button classes to quickly create a styled button.
Main Variations
Secondary Variations
Conveying meaning to assistive technologies
Using color to add meaning to a button only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the visible text of the button), or is included through alternative means, such as additional text hidden with the .sr-only class.
Wrapping text within the button
By default, Bootstrap ensures that the text within a button does not wrap. The reason has a long history in UX considerations, such as those outlined in UX Movement's rules [Ed.: text case being arbitrary]. The same best practices for naming hyperlinks apply (e.g., no wordy "click here to" or generic "more" labels). With buttons, the rules extend further because their labels should stand out by using active verbs that convey the meaning of the action precisely and succinctly. The button labels are normally echoing wording that is used above them that asks a user a specific question. In the event there is a need to wrap the inner text of a button because its text causes the button to flow outside of its container, apply the btn-wrap-normal class.
Without the class
This area is 5/6 of a row's width.
With the class
This area is 5/6 of a row's width.
Sizes
Fancy larger or smaller buttons? Add .btn-lg, .btn-sm, or .btn-xs for additional sizes.
Spacing
Placing buttons side-by-side can create usability issues in determining where each button begins and ends, especially if all buttons are the same color. Add the following classes to the wrapping tag to add more button to the default side-by-side spacing: .btn-spacing-1, .btn-spacing-2, .btn-spacing-3, or .btn-spacing-4
Alignment
Buttons are aligned to the left by default.
Right Align
You can align buttons to the right by applying .pull-right.
Align to Heading
If different sections on a page require buttons only relevant to that section, you can create an in-line section heading with buttons by wrapping the buttons in a surrounding div with .button-nav.
The buttons will align to the right of the screen through the medium breakpoint and then align to the left on small through x-small breakpoints.
Section Heading
Block Level
Create block level buttons—those that span the full width of a parent— by adding .btn-block. These buttons will always be centered.
Active state
Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <button> elements, this is done via :active. For <a> elements, it's done with .active. However, you may use .active on <button>s (and include the aria-pressed="true" attribute) should you need to replicate the active state programmatically.
Button element
No need to add :active as it's a pseudo-class, but if you need to force the same appearance, go ahead and add .active.
We use .disabled as a utility class here, similar to the common .active class, so no prefix is required.
Link functionality caveat
This class uses pointer-events: none to try to disable the link functionality of <a>s, but that CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11. In addition, even in browsers that do support pointer-events: none, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, use custom JavaScript to disable such links.
Code
Inline
Wrap inline snippets of code with <code>.
For example, <section> should be wrapped as inline.
User input
Use the <kbd> to indicate input that is typically entered via keyboard.
To switch directories, type cd followed by the name of the directory.
To edit settings, press ctrl + ,
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>
You may optionally add the .pre-scrollable class, which will set a max-height of 350px and provide a y-axis scrollbar.
Variables
For indicating variables use the <var> tag.
y = mx + b
Sample output
For indicating blocks sample output from a program use the <samp> tag.
This text is meant to be treated as sample output from a computer program.
Forms
Basic example
Individual form controls automatically receive some global styling. All textual <input>, <textarea>, and <select> elements with .form-control are set to width: 100%; by default. Wrap labels and controls in .form-group for optimum spacing.
Don't mix form groups with input groups
Do not mix form groups directly with input groups. Instead, nest the input group inside of the form group.
Inline form
Add .form-inline to your form (which doesn't have to be a <form>) for left-aligned and inline-block controls. This only applies to forms within viewports that are at least 768px wide.
May require custom widths
Inputs and selects have width: 100%; applied by default in Bootstrap. Within inline forms, we reset that to width: auto; so multiple controls can reside on the same line. Depending on your layout, additional custom widths may be required.
Always add labels
Screen readers will have trouble with your forms if you don't include a label for every input. For these inline forms, you can hide the labels using the .sr-only class. There are further alternative methods of providing a label for assistive technologies, such as the aria-label, aria-labelledby or title attribute. If none of these is present, screen readers may resort to using the placeholder attribute, if present, but note that use of placeholder as a replacement for other labelling methods is not advised.
Horizontal form
Use Bootstrap's predefined grid classes to align labels and groups of form controls in a horizontal layout by adding .form-horizontal to the form (which doesn't have to be a <form>). Doing so changes .form-groups to behave as grid rows, so no need for .row.
Supported controls
Examples of standard form controls supported in an example form layout.
Inputs
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color. Using these input types are especially important for usability on mobile devices and prompting keyboard suggestions.
For inputs that need a calendar for a single date or date range, we have a plug-in that can be used that is styled with our FEF. This date picker does not currently support time (hh:mm). For further documentation around the plug-in: https://bootstrap-datepicker.readthedocs.io/en/stable/index.html
Form control which supports multiple lines of text. Change rows attribute as necessary.
Checkbox and radio buttons
Checkboxes enable the selection of one or several options in a list, while radio buttons allow the selection of one option from many.
Disabled checkboxes and radio buttons are supported. To provide a "not-allowed" cursor on hover of the parent <label>, you'll need to add the .disabled class to the parent .radio, .radio-inline, .checkbox, or .checkbox-inline.
Default (stacked)
Inline form
Use the class .form-inline to modify the form and receive automatic inline styling for checkbox and/or radio button groups.
Custom inline options for a default form
In a default (stacked) form, use .legend-inline along with .checkbox-inline or .radio-inline classes on a series of checkboxes or radio buttons to make controls appear on the same line.
Custom inline options for stacking the group title
In a default (stacked) form, use only the .checkbox-inline or .radio-inline classes on a series of checkboxes or radio buttons to make controls appear on the same line. Avoid adding the .legend-inline style to make the group title appear on the line above it.
No label text
Without text within the <label> tag, the input is positioned as expected. This currently only works on non-inline checkboxes and radio buttons. Remember to still provide some form of label for assistive technologies (for instance, using aria-label).
When no option has the selected attribute, the default option shown within the select menu will be the first enabled option within the list.
When a label tag is present the messaging to further describe the purpose of the select menu to the user - as a disabled option - is optional, but the aria-label is still recommended.
Single selection menu/no label
When no option has the selected attribute, the default option shown within the select menu will be the first enabled option within the list.
When the select form does not include a label tag:
The aria-label attribute should be included within the select tag.
Add messaging as a disabled option to further describe the purpose of the select menu to the user.
Multiple selections menu
Add the multiple attribute to allow selecting more than one option.
You should replace the aria-label with the title attribute to show the title within the select field and to further describe the purpose of the select menu to the user.
Multiple selections menu with growing height
Add the multiple attribute to allow selecting more than one option.
You should replace the aria-label with the title attribute to show the title within the select field and to further describe the purpose of the select menu to the user.
Add the data-multiple-separator="<br>" to display each selected option as a new line item within the select field.
File browser
Plugin Required
We use a customized version of Bootstrap 4's bs-custom-file-input in order to provide textual feedback in the label.
The file input requires additional JavaScript to hook it up with the functional Choose file… and selected file name text. Be sure to match the 'id' and 'for' values of the input and label tags.
When the user touches the input box or button, a file upload window specific to the user's OS will appear. Once the user selects a file, its filename will be shown in the input text box. If more than one file is selected, a phrase indicating the number of files selected will appear. Additional feedback may be placed in the "help-block" section as needed.
Default Button for File Selection
Single File Selection
Required File Selection
Add the class .required to the .custom-file-group container.
Multiple File Selection
Disabled
We hide the default file <input> via opacity and instead style the <label>. The button is generated and positioned with ::after. Lastly, we declare a width and height on the <input> for proper spacing for surrounding content.
Translating or customizing the strings with Sass and JS
The :lang() pseudo-class is used to allow for translation of the “Browse” text into other languages. Override or add entries to the $custom-file-text Sass variable with the relevant language tag and localized strings. You may find these in the /src/sass/modules/_custom-file-input.scss file. The English strings may be customized the same way.
lang Attribute Required for Localization
The lang attribute must be applied to a parent tag for the button and feedback translations to take effect. This will work if the attribute is applied to the html tag or on a container element as shown in the examples further below.
_custom-file-input.scss translations
Additionally, for multiple file selection, we have customized the JavaScript plug-in as bs-custom-file-input-custom.js to provide localized feedback.
bs-custom-file-input-custom.js translations
The # in the phrases below are replaced with the total number of file selected. If none are present, the total number is placed at the beginning of the phrase.
Localization Examples
The label text used for the placeholder text in the faux input box and the help-block text is custom; therefore, it will need to be translated and added manually.
You’ll need to set the language of your document (or subtree thereof) correctly in order for the correct text to be shown. This can be done using the lang attribute on the <html> element or the Content-Language HTTP header, among other methods.
Static control
When you need to place plain text next to a form label within a form, use the .form-control-static class on a <p>.
Focus state
We remove the default outline styles on some form controls and apply a box-shadow in its place for :focus.
Demo :focus state
The above example input uses custom styles in our documentation to demonstrate the :focus state on a .form-control.
Disabled state
Add the disabled boolean attribute on an input to prevent user interactions. Disabled inputs appear lighter and adds a not-allowed cursor.
The disabled styling for a select requires no special markup besides the disabled boolean attribute.
Disabled fieldsets
Add the disabled attribute to a <fieldset> to disable all the controls within the <fieldset> at once.
Caveat about link functionality of <a>
By default, browsers will treat all native form controls (<input>, <select> and <button> elements) inside a <fieldset disabled> as disabled, preventing both keyboard and mouse interactions on them. However, if your form also includes <a ... class="btn btn-*"> elements, these will only be given a style of pointer-events: none. As noted in the section about disabled state for buttons (and specifically in the sub-section for anchor elements), this CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11, and won't prevent keyboard users from being able to focus or activate these links. So to be safe, use custom JavaScript to disable such links.
Cross-browser compatibility
While Bootstrap will apply these styles in all browsers, Internet Explorer 11 and below don't fully support the disabled attribute on a <fieldset>. Use custom JavaScript to disable the fieldset in these browsers.
Readonly state
Add the readonly boolean attribute on an input to prevent modification of the input's value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor.
Help text
Block level help text for form controls.
Associating help text with form controls
Help text should be explicitly associated with the form control it relates to using the aria-describedby attribute. This will ensure that assistive technologies – such as screen readers – will announce this help text when the user focuses or enters the control.
Validating forms
Form validation is not built into the framework. Use a third party plug-in like the JQuery Validation Plugin to check and make sure forms have required fields completed before submission. See the documentation and demos for further details.
Validation states
Bootstrap includes validation styles for error, warning, and success states on form controls. To use, add .has-warning, .has-error, or .has-success to the parent element. Any .control-label, .form-control, and .help-block within that element will receive the validation styles.
Conveying validation state to assistive technologies and colorblind users
Using these validation styles to denote the state of a form control only provides a visual, color-based indication, which will not be conveyed to users of assistive technologies—such as screen readers—or to colorblind users.
Ensure that an alternative indication of state is also provided. For instance, you can
include a hint about state in the form control's <label> text itself (as shown below)
include a Lexicon with appropriate alternative text using the .sr-only class (see Lexicon examples)
assign an aria-invalid="true" attribute to invalid form controls for assistive technologies
Validation states on a dark background
If a form is on a dark background, the validation states automatically update to be more visible, with a white background color behind the help block for readability.
Validation states on a light background
If a form is on a light background, the validation states automatically update to be more visible, with a white background color behind the help block for readability.
Validation feedback
Use the following approaches to provide feedback after validating a form.
Optional feedback icons
You can also add optional feedback icons with the addition of .has-feedback and the right icon.
Feedback icons only work with textual <input class="form-control"> elements.
Icons, labels, and input groups
Manual positioning of feedback icons is required for inputs without a label and for input groups with an add-on on the right. You are strongly encouraged to provide labels for all inputs for accessibility reasons. If you wish to prevent labels from being displayed, hide them with the .sr-only class. If you must do without labels, adjust the top value of the feedback icon. For input groups, adjust the right value to an appropriate pixel value depending on the width of your addon.
Conveying the icon's meaning to assistive technologies
To ensure that assistive technologies – such as screen readers – correctly convey the meaning of an icon, additional hidden text should be included with the .sr-only class and explicitly associated with the form control it relates to using aria-describedby. Alternatively, ensure that the meaning (for instance, the fact that there is a warning for a particular text entry field) is conveyed in some other form, such as changing the text of the actual <label> associated with the form control.
Although the following examples already mention the validation state of their respective form controls in the <label> text itself, the above technique (using .sr-only text and aria-describedby) has been included for illustrative purposes.
Feedback icons in horizontal forms
Feedback icons in inline forms
Feedback icons with .sr-only labels
If you use the .sr-only class to hide a form control's <label> (rather than using other labelling options, such as the aria-label attribute), Bootstrap will automatically adjust the position of the icon once it's been added.
(success)
@
(success)
Styling Required Form Elements
To style required form elements, the .required class should be applied to the form element's parent div tag with the class control-group.
The required HTML attribute
Adding the required attribute to a form tag will not style it as a required element. The element must be a child element of a div tag with both classes of .control-group and .required.
For basic HTML5 validation, the required attribute also should be added to the specific form element.
Basic stacked form with required input fields
Horizontal form with required input fields
Inline form with required input fields
Required radio button group
The required HTML attribute for radio buttons
For basic HTML5 validation with radio buttons, the required attribute should be added to the first radio button input tag. There is no need to add this to the following radio button input tags because the browser will interpret that one of them needs to be selected and the required attribute will applied to each of them.
Required checkbox group
The required HTML attribute for checkboxes
Basic HTML5 validation with a group of checkboxes is not available. To achieve this type of functionality, validation through JavaScript would be required.
The reason JavaScript is needed for this functionality is because the required attribute cannot be applied to a group of checkboxes as it can for radio buttons. The required attribute also cannot be applied to a single checkbox input tag. Doing so would make that specific checkbox required.
Control sizing
Set heights using classes like .input-lg, and set widths using grid column classes like .col-lg-*.
Height sizing
Create taller or shorter form controls that match button sizes.
Horizontal form group sizes
Quickly size labels and form controls within .form-horizontal by adding .form-group-lg or .form-group-sm.
Column sizing
Wrap inputs in grid columns, or any custom parent element, to easily enforce desired widths.
Grid system
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 predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.
Introduction
Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap grid system works:
Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding.
Use rows to create horizontal groups of columns.
Content should be placed within columns, and only columns may be immediate children of rows.
Predefined grid classes like .row and .col-xs-4 are available for quickly making grid layouts. Less mixins can also be used for more semantic layouts.
Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and last column via negative margin on .rows.
The negative margin is why the examples below are outdented. It's so that content within grid columns is lined up with non-grid content.
Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three .col-xs-4.
If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.
Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, e.g. applying any .col-md-* class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg-* class is not present.
Look to the examples for applying these principles to your code.
Media queries
We use the following media queries in our Less files to create the key breakpoints in our grid system.
We occasionally expand on these media queries to include a max-width to limit CSS to a narrower set of devices.
Grid options
See how aspects of the Bootstrap grid system work across multiple devices with a handy table.
Extra small devices
Phones (<768px)
Small devices
Tablets (≥768px)
Medium devices
Desktops (≥992px)
Large devices
Desktops (≥1200px)
Grid behavior
Horizontal at all times
Collapsed to start, horizontal above breakpoints
Container width
None (auto)
750px
970px
1170px
Class prefix
.col-xs-
.col-sm-
.col-md-
.col-lg-
# of columns
12
Column width
Auto
~57px
~77px
~92px
Gutter width
40px (20px on each side of a column)
Nestable
Yes
Nested gutter width
20px (10px on each side of a column)
Offsets
Yes
Column ordering
Yes
Example: Stacked-to-horizontal
Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any .row.
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-8
.col-md-4
.col-md-4
.col-md-4
.col-md-4
.col-md-6
.col-md-6
Example: Five-Column Grid
Because the default grid system is not divisible by five, use a special set of classes to achieve a 5-column grid when needed. Either the 12-column default grid or the 5-column grid may be nested within these as well.
.col-md-1-5
.col-md-1-5
.col-md-1-5
.col-md-1-5
.col-md-1-5
.col-md-4-5
.col-md-1-5
.col-md-3-5
.col-md-2-5
.col-md-2-5
.col-md-1-5
.col-md-2-5
.col-md-1-5
.col-md-3-5
.col-md-1-5
.col-md-1-5
Level 1: .col-md-3-5
Level 2: .col-xs-6
Level 2: .col-xs-6
.col-md-1-5
Column Ordering for the 5-Column Grid
.col-md-3-5 .col-md-push-2-5
.col-md-2-5 .col-md-pull-3-5
Example: Fluid container
Turn any fixed-width grid layout into a full-width layout by changing your outermost .container to .container-fluid.
Example: Mobile and desktop
Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding .col-xs-*.col-md-* to your columns. See the example below for a better idea of how it all works.
.col-xs-12 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6
.col-xs-6
Example: Mobile, tablet, desktop
Build on the previous example by creating even more dynamic and powerful layouts with tablet .col-sm-* classes.
.col-xs-12 .col-sm-6 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
Example: Column wrapping
If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.
.col-xs-9
.col-xs-4 Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.
.col-xs-6 Subsequent columns continue along the new line.
Responsive column resets
With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a .clearfix and our responsive utility classes.
.col-xs-6 .col-sm-3
Resize your viewport or check it out on your phone for an example.
.col-xs-6 .col-sm-3
.col-xs-6 .col-sm-3
.col-xs-6 .col-sm-3
In addition to column clearing at responsive breakpoints, you may need to reset offsets, pushes, or pulls. See this in action in the grid example.
Remove gutters
Remove the gutters from a row and it's columns with the .row-no-gutters class.
.col-xs-12 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6
.col-xs-6
Offsetting columns
Move columns to the right using .col-md-offset-* classes. These classes increase the left margin of a column by * columns. For example, .col-md-offset-4 moves .col-md-4 over four columns.
.col-md-4
.col-md-4 .col-md-offset-4
.col-md-3 .col-md-offset-3
.col-md-3 .col-md-offset-3
.col-md-6 .col-md-offset-3
You can also override offsets from lower grid tiers with .col-*-offset-0 classes.
Nesting columns
To nest your content with the default grid, add a new .row and set of .col-sm-* columns within an existing .col-sm-* column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns).
Level 1: .col-sm-9
Level 2: .col-xs-8 .col-sm-6
Level 2: .col-xs-4 .col-sm-6
Column ordering
Easily change the order of our built-in grid columns with .col-md-push-* and .col-md-pull-* modifier classes.
.col-md-9 .col-md-push-3
.col-md-3 .col-md-pull-9
Less mixins and variables
In addition to prebuilt grid classes for fast layouts, Bootstrap includes Less variables and mixins for quickly generating your own simple, semantic layouts.
Variables
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.
Mixins
Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.
Example usage
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.
Helper classes
Contextual colors
Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Dealing with specificity
Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <span> with the class.
Conveying meaning to assistive technologies
Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the contextual colors are only used to reinforce meaning that is already present in the text/markup), or is included through alternative means, such as additional text hidden with the .sr-only class.
Contextual backgrounds
Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Dealing with specificity
Sometimes contextual background classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a <div> with the class.
Conveying meaning to assistive technologies
As with contextual colors, ensure that any meaning conveyed through color is also conveyed in a format that is not purely presentational.
Close icon
Use the generic close icon for dismissing content like modals and alerts.
Carets
Use carets to indicate dropdown functionality and direction. Note that the default caret will reverse automatically in dropup menus.
Quick floats
Float an element to the left or right with a class. !important is included to avoid specificity issues. Classes can also be used as mixins.
Not for use in navbars
To align components in navbars with utility classes, use .navbar-left or .navbar-right instead. See the navbar docs for details.
Center content blocks
Set an element to display: block and center via margin. Available as a mixin and class.
You can also align display:block elements to the left and right using .left-block and .right-block
Center content blocks with flex
These classes utilize the flex properties and reduce the dependency on margin and absolute positioning specifications, which would sometimes result in undesired spacing conflicts.
If you want to center the content within a container, and stack the elements like a column, use .column-align-vertical-center on the wrapping div. Please note, this will not affect text alignment, so you will need to add .text-center to your markup if that is the desired layout.
Drivers & downloads
If you want to center the content within a container, but leave the elements in-line like a row, use .row-align-vertical-center on the wrapping div. Please note, if you want the items to also align horizontally, the individual items need to be the same height, which can be achieved by adding/removing margin classes on those individual elements.
Drivers & downloads
Clearfix
Easily clear floats by adding .clearfixto the parent element. Utilizes the micro clearfix as popularized by Nicolas Gallagher. Can also be used as a mixin.
Showing and hiding content
Force an element to be shown or hidden (including for screen readers) with the use of .show and .hidden classes. These classes use !important to avoid specificity conflicts, just like the quick floats. They are only available for block level toggling. They can also be used as mixins.
.hide is available, but it does not always affect screen readers and is deprecated as of v3.0.1. Use .hidden or .sr-only instead.
Furthermore, .invisible can be used to toggle only the visibility of an element, meaning its display is not modified and the element can still affect the flow of the document.
Screen reader and keyboard navigation content
Hide an element to all devices except screen readers with .sr-only. Combine .sr-only with .sr-only-focusable to show the element again when it's focused (e.g. by a keyboard-only user). Necessary for following accessibility best practices. Can also be used as mixins.
Image replacement
Utilize the .text-hide class or mixin to help replace an element's text content with a background image.
Padding and Margins
Specific padding classes used when extra (or less) spacing is required for a component or column. These modifier classes naming convention are in steps from 1-4.
Alternate spacing styles
These alternate padding styles break default layouts set within the framework and should be used with caution. Any break from the standard grid should be thoughtful and as always, backed by sound reasoning.
For all other cases use the base component padding.
Full Padding/Margin
The modifier classes for full padding are Deprecated:.l-pad-*, whereas * is a number from 1-10. New:.padding-*, whereas * is a number from 1-6 and an additional class of .padding-none to remove any padding.
The modifier classes for full margins are the same as full padding but with a class of .margin-* instead of a classe of .padding-*
.padding-none
.padding-2
.padding-4
.margin-none
.margin-2
.margin-4
Padding/Margin Top and Bottom
The modifier classes for top and bottom padding are Deprecated:.l-pad-top-* and .l-pad-bottom-*, whereas * is a number from 1-10. New:.padding-* whereas * is a number from 1-6 and additional classes of .padding-top-none and .padding-bottom-none to remove any top/bottom padding.
The modifier classes for top and bottom are the same as padding but with a class of .margin-* instead of a classe of .padding-*
.padding-top-none
.padding-top-2
.padding-top-4
.margin-top-none
.margin-top-2
.margin-top-4
Padding/Margin Before and After
The modifier classes for before and after padding are Deprecated:.l-pad-before-* and .l-pad-after-*, whereas * is a number from 1-10. New:.padding-* whereas * is a number from 1-6 and additional classes of .padding-before-none and .padding-after-none to remove any before/after padding.
The modifier classes for before and after margins are the same as padding but with a class of .margin-* instead of a classe of .padding-*
.padding-before-none
.padding-before-2
.padding-before-4
.margin-before-none
.margin-before-2
.margin-before-4
Padding/Margin Hidden at Breakpoints
All padding or margins may be removed by using any of the screen size classes.
padding-xs and margin-xs
normal
.padding-xs-none
.padding-xs-top-none
.padding-xs-bottom-none
.padding-xs-before-none
.padding-xs-after-none
normal
.margin-xs-none
.margin-xs-top-none
.margin-xs-bottom-none
.margin-xs-before-none
.margin-xs-after-none
padding-sm and margin-sm
normal
.padding-sm-none
.padding-sm-top-none
.padding-sm-bottom-none
.padding-sm-before-none
.padding-sm-after-none
normal
.margin-sm-none
.margin-sm-top-none
.margin-sm-bottom-none
.margin-sm-before-none
.margin-sm-after-none
padding-md and margin-md
normal
.padding-md-none
.padding-md-top-none
.padding-md-bottom-none
.padding-md-before-none
.padding-md-after-none
normal
.margin-md-none
.margin-md-top-none
.margin-md-bottom-none
.margin-md-before-none
.margin-md-after-none
padding-lg and margin-lg
normal
.padding-lg-none
.padding-lg-top-none
.padding-lg-bottom-none
.padding-lg-before-none
.padding-lg-after-none
normal
.margin-lg-none
.margin-lg-top-none
.margin-lg-bottom-none
.margin-lg-before-none
.margin-lg-after-none
Positioning Classes
In some rare cases, you may need to set the position property on a container to accomodate alignments or other positioning needs. Rather than use inline styles, we have provided basic classes that you may use:
.absolute = position: absolute !important
.relative = position: relative !important
Borders
Use these classes to add and remove borders, change their colors and/or thickness. Multiple classes can be applied at one time to achieve a desired design pattern.
Individual sides
To add individual borders to a div, apply .border-top, .border-after, .border-bottom and/or .border-before. These classes can be used individually or in combination with one another.
.border-top
.border-bottom
.border-before .border-after
.border-top .border-after .border-bottom
All sides
If a border is needed for all sides of a div, use the class .border-all instead of adding each border-side class individually.
.border-all
Colors
Any color from our color palette can be applied to a border. To achieve this design pattern, add the border position class(es) first and then an additional border class with the suffix color name.
.border-top .border-b1
.border-before .border-after .border-b9
.border-all .border-b7
Thickness
The default border size is set to 1px, but if a thicker border is needed there is a 4px option. To achieve this design pattern, add the border position class(es) first and then an additional border class with the suffix -thick.
All borders may be hidden by using any of the screen size classes: .border-hidden-xs, .border-hidden-sm, .border-hidden-md, .border-hidden-lg.
.border-all .border-hidden-xs
.border-all .border-hidden-sm
.border-all .border-hidden-md
.border-all .border-hidden-lg
Hide individual sides by adding the suffix -hidden-xs, -hidden-sm, -hidden-md, -hidden-lg to the desired side class.
.border-all .border-before-hidden-xs
.border-all .border-before-hidden-sm
.border-all .border-before-hidden-md
.border-all .border-before-hidden-lg
Removing default borders
Use the classes below when you need to remove a border from a pre-existing bordered element, such as wells, tabs, accordions, etc.
.border-top-none
.border-after-none
.border-bottom-none
.border-before-none
.border-none
Images
Responsive images
Images in Bootstrap 3 can be made responsive-friendly via the addition of the .img-responsive class. This applies max-width: 100%;, height: auto; and display: block; to the image so that it scales nicely to the parent element.
To center images which use the .img-responsive class, use .center-block instead of .text-center. See the helper classes section for more details about .center-block usage.
SVG images and IE 8-10
In Internet Explorer 8-10, SVG images with .img-responsive are disproportionately sized. To fix this, add width: 100% \9; where necessary. Bootstrap doesn't apply this automatically as it causes complications to other image formats.
Image Standard and Borders
Add classes to an <img> element to easily style images in any project.
Preferred image heights
Image sizes should try to adhere to the 12px vertical rhythm by having heights divisible by 12.
Images with animation
Currently support scaling of an image with hover.
Responsive utilities
For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query. Also included are utility classes for toggling content when printed.
Try to use these on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.
Available classes
Use a single or combination of the available classes for toggling content across viewport breakpoints.
Extra small devices
Phones (<768px)
Small devices
Tablets (≥768px)
Medium devices
Desktops (≥992px)
Large devices
Desktops (≥1200px)
.visible-xs-*
Visible
Hidden
Hidden
Hidden
.visible-sm-*
Hidden
Visible
Hidden
Hidden
.visible-md-*
Hidden
Hidden
Visible
Hidden
.visible-lg-*
Hidden
Hidden
Hidden
Visible
.hidden-xs
Hidden
Visible
Visible
Visible
.hidden-sm
Visible
Hidden
Visible
Visible
.hidden-md
Visible
Visible
Hidden
Visible
.hidden-lg
Visible
Visible
Visible
Hidden
As of v3.2.0, the .visible-*-* classes for each breakpoint come in three variations, one for each CSS display property value listed below.
Group of classes
CSS display
.visible-*-block
display: block;
.visible-*-inline
display: inline;
.visible-*-inline-block
display: inline-block;
So, for extra small (xs) screens for example, the available .visible-*-* classes are: .visible-xs-block, .visible-xs-inline, and .visible-xs-inline-block.
The classes .visible-xs, .visible-sm, .visible-md, and .visible-lg also exist, but are deprecated as of v3.2.0. They are approximately equivalent to .visible-*-block, except with additional special cases for toggling <table>-related elements.
Print classes
Similar to the regular responsive classes, use these for toggling content for print.
The class .visible-print also exists but is deprecated as of v3.2.0. It is approximately equivalent to .visible-print-block, except with additional special cases for <table>-related elements.
Test cases
Resize your browser or load on different devices to test the responsive utility classes.
Visible on...
Green checkmarks indicate the element is visible in your current viewport.
Extra small✔ Visible on x-small
Small✔ Visible on small
Medium✔ Visible on medium
Large✔ Visible on large
Extra small and small✔ Visible on x-small and small
Medium and large✔ Visible on medium and large
Extra small and medium✔ Visible on x-small and medium
Small and large✔ Visible on small and large
Extra small and large✔ Visible on x-small and large
Small and medium✔ Visible on small and medium
Hidden on...
Here, green checkmarks also indicate the element is hidden in your current viewport.
Extra small✔ Hidden on x-small
Small✔ Hidden on small
Medium✔ Hidden on medium
Large✔ Hidden on large
Extra small and small✔ Hidden on x-small and small
Medium and large✔ Hidden on medium and large
Extra small and medium✔ Hidden on x-small and medium
Small and large✔ Hidden on small and large
Extra small and large✔ Hidden on x-small and large
Small and medium✔ Hidden on small and medium
Tables
Basic example
For basic styling—light padding and only horizontal dividers—add the base class .table to any <table>. It may seem super redundant, but given the widespread use of tables for other plugins like calendars and date pickers, we've opted to isolate our custom table styles.
Optional table caption.
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
Content alignment options
As a default, the content within a table row is vertically aligned with the top of the parent. You can apply .align-bottom or .align-center to the <th> and/or <td> to achieve different layouts.
Use .table-striped to add zebra-striping to any table row within the <tbody>.
Cross-browser compatibility
Striped tables are styled via the :nth-child CSS selector, which is not available in Internet Explorer 8.
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
Bordered table
Add .table-bordered for borders on all sides of the table and cells.
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
Condensed table
Add .table-condensed to make tables more compact by cutting cell padding in half.
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry the Bird
@twitter
Hover rows
Add .table-hover to enable a hover state on table rows within a <tbody>.
#
First Name
Last Name
Username
1
Mark
Otto
@mdo
2
Jacob
Thornton
@fat
3
Larry
the Bird
@twitter
Buttons within tables
Use the .btn-xs and .btn-ghost to style the buttons. Add icons where applicable for a quick scan and to provide better context. The buttons must be wrapped in a div and use .btn-nowrap.
#
First Name
Last Name
Actions
1
Mark
Otto
2
Jacob
Thornton
3
Larry
the Bird
Contextual classes
Use contextual classes to color table rows or individual cells.
Class
Description
.active
Applies the hover color to a particular row or cell
.success
Indicates a successful or positive action
.info
Indicates a neutral informative change or action
.warning
Indicates a warning that might need attention
.danger
Indicates a dangerous or potentially negative action
#
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
8
Column content
Column content
Column content
9
Column content
Column content
Column content
Conveying meaning to assistive technologies
Using color to add meaning to a table row or individual cell only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the visible text in the relevant table row/cell), or is included through alternative means, such as additional text hidden with the .sr-only class.
Form elements within tables
Tables can be interactive and allow form elements within table cells.
#
First Name
Last Name
User Group
1
2
Responsive tables
Create responsive tables by wrapping any .table in .table-responsive to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.
Vertical clipping/truncation
Responsive tables make use of overflow-y: hidden, which clips off any content that goes beyond the bottom or top edges of the table. In particular, this can clip off dropdown menus and other third-party widgets.
Firefox and fieldsets
Firefox has some awkward fieldset styling involving width that interferes with the responsive table. This cannot be overridden without a Firefox-specific hack that we don't provide in Bootstrap:
Create sortable tables by adding .table-sortable to any table to allow table to be sorted based on column input.
Sortable Table Plugin
Sortable tables make use of third-party jQuery plugin tablesorter 2.0 to make it work properly.
For more information, read the plugin documentation.
#
Name
Currency
Date
2
Jerry
$1.00
05/04/2015
1
Bruce
$32.50
01/01/2015
3
Clark
-$99.21
01/12/2016
Card tables
Add .table-cards to display table rows as cards. This will create a grid of 12 columns which you can fill in with cards. You will need to add breakpoint classes to the <tr> elements as well
Icon
Name
Linux
OSX
Windows
Twitter
Facebook
Google+
You can create a toggle between cards and a standard table by adding/removing the .table-cards class from the <table>
All HTML headings, <h1> through <h6>, are available. .h1 through .h6 classes are also available, for when you want to match the font styling of a heading but still want your text to be displayed inline.
h1 jumbo heading
2.985984rem / 4.5rem
47.7757px / 72px
h1 heading
2.0736rem / 3rem
33.1776px / 48px
h2 heading
1.728rem / 2.625rem
27.648px / 42px
h3 heading
1.44rem / 2.25rem
23.04px / 36px
h4 heading
1.2rem / 1.875rem
19.2px / 30px
h5 heading
1rem / 1.5rem
16px / 24px
h6 heading
0.8333333333rem / 1.3125rem
13.3333px / 21px
Create lighter, secondary text in any heading with a generic <small> tag or the .small class.
h1 jumbo heading Secondary text
h1 heading Secondary text
h2 heading Secondary text
h3 heading Secondary text
h4 heading Secondary text
h5 heading Secondary text
h6 heading Secondary text
Custom Headings
Number Headings
Wrap the number heading in a <div> tag with the class .number-heading. Use <span> tags to enclose each section as shown below, using .number, .prefix, .infix, and .suffix. For the suffix section, if text is needed, use the .suffix-text class or .suffix-text-block to keep all of the text on a separate line. Due to limitations of HTML markup, all <span> sections must not contain any spaces between each section.
Use the class .symbol to stylize any of three sections: prefix, infix, or suffix.
Horizontal alignment can be achieved by using the current text alignment classes. For vertical alignment of any of the three sections, add .valign-top or .valign-center. The default vertical alignment is bottom. Vertical alignment is not available for the .number section.
Percentages
88%
88%
%88
In Persian and Turkish, the percent sign precedes the number.
Currency
Use the class .symbol to signify currency values. The class .cent may also be used to show a decimal value. The typical vertical alignment classes may be applied to either of these.
$57
$32.95
32.95$
€27.94
27.94€
Text
Text may be placed in either the middle (.infix) or the end (.suffix) sections. The typical vertical alignment classes may be applied to either of these. If the text should begin on a separate line below the number, use the .suffix-text-block
1out of4
4of5
3million
3million
Body copy
LXCore's global default font-size is 16px, with a line-height of 1.5 (24px). This is applied to the <body> and all paragraphs. In addition, <p> (paragraphs) receive a bottom margin of half their computed line-height (10px by default).
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.
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.
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.
Lead body copy
Make a paragraph stand out by adding .lead.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
Built with Sass
The typographic scale is based on two Sass variables: @font-size-base and @line-height-base. 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.
Column Fill
This equally distributes content across multiple columns. The .column-fill-* classes need to be applied to the parent element to work as expected. For example, if you are dividing an unordered list across multiple columns the .column-fill-* classes need to be applied to the <ul> tag. Additional examples of implementation are below.
Cross-browser compatibility
CSS Columns are not supported in Internet Explorer 9 and below. These browsers will show one column
Split into 2 columns
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum rhoncus, purus sit amet facilisis molestie, magna diam ultricies erat, eu scelerisque turpis sapien ac nunc. Ut nec neque scelerisque quam efficitur tincidunt id sit amet velit. Vestibulum accumsan luctus urna. Suspendisse sed pulvinar lorem.
Split into 3 columns
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum rhoncus, purus sit amet facilisis molestie, magna diam ultricies erat, eu scelerisque turpis sapien ac nunc. Ut nec neque scelerisque quam efficitur tincidunt id sit amet velit. Vestibulum accumsan luctus urna. Suspendisse sed pulvinar lorem.
Split into 2 columns, multiple paragraphs
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum rhoncus, purus sit amet facilisis molestie, magna diam ultricies erat, eu scelerisque turpis sapien ac nunc. Ut nec neque scelerisque quam efficitur tincidunt id sit amet velit. Vestibulum accumsan luctus urna. Suspendisse sed pulvinar lorem.
Curabitur ornare varius enim, porta pellentesque est maximus pretium. Integer est magna, commodo nec mi eget, molestie bibendum arcu. Morbi eget purus non magna suscipit malesuada. Sed vel nunc tortor. Etiam vel lectus a metus fermentum sollicitudin. Suspendisse blandit massa vitae tortor consequat, a efficitur lorem vehicula.
Maecenas dictum, mi vitae condimentum rutrum, libero odio tincidunt lectus, in eleifend arcu ligula id purus. Ut tempus lectus ut massa tincidunt, at ullamcorper nulla volutpat. In rhoncus tincidunt dui non elementum. Sed ut tortor tempus, auctor justo eu, lobortis urna. Curabitur at rutrum est. In rhoncus ipsum mauris, id blandit orci efficitur tincidunt. Donec ultricies tempor consequat. Nullam tristique ornare ligula eget tempus.
Split into columns responsively
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum rhoncus, purus sit amet facilisis molestie, magna diam ultricies erat, eu scelerisque turpis sapien ac nunc. Ut nec neque scelerisque quam efficitur tincidunt id sit amet velit. Vestibulum accumsan luctus urna. Suspendisse sed pulvinar lorem.
Curabitur ornare varius enim, porta pellentesque est maximus pretium. Integer est magna, commodo nec mi eget, molestie bibendum arcu. Morbi eget purus non magna suscipit malesuada. Sed vel nunc tortor. Etiam vel lectus a metus fermentum sollicitudin. Suspendisse blandit massa vitae tortor consequat, a efficitur lorem vehicula.
Maecenas dictum, mi vitae condimentum rutrum, libero odio tincidunt lectus, in eleifend arcu ligula id purus. Ut tempus lectus ut massa tincidunt, at ullamcorper nulla volutpat. In rhoncus tincidunt dui non elementum. Sed ut tortor tempus, auctor justo eu, lobortis urna. Curabitur at rutrum est. In rhoncus ipsum mauris, id blandit orci efficitur tincidunt. Donec ultricies tempor consequat. Nullam tristique ornare ligula eget tempus.
Split into columns with a button list
You need to add .column-fill-btn-list to the <ul> for button hover states to stay within their designated rows.
For highlighting a run of text due to its relevance in another context, use the <mark> tag.
You can use the mark tag to highlight text.
Deleted text
For indicating blocks of text that have been deleted use the <del> tag.
This line of text is meant to be treated as deleted text.
Strikethrough text
For indicating blocks of text that are no longer relevant use the <s> tag.
This line of text is meant to be treated as no longer accurate.
Inserted text
For indicating additions to the document use the <ins> tag.
This line of text is meant to be treated as an addition to the document.
Underlined text
To underline text use the <u> tag.
This line of text will render as underlined
Make use of HTML's default emphasis tags with lightweight styles.
Small text
For de-emphasizing inline or blocks of text, use the <small> tag to set text at 85% the size of the parent. Heading elements receive their own font-size for nested <small> elements.
You may alternatively use an inline element with .small in place of any <small>.
This line of text is meant to be treated as fine print.
Bold
For emphasizing a snippet of text with a heavier font-weight.
The following snippet of text is rendered as bold text.
Italics
For emphasizing a snippet of text with italics.
The following snippet of text is rendered as italicized text.
Alternate elements
Feel free to use <b> and <i> in HTML5. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.
Size classes
Change body text sizes using the LxCore ratio (1.2) with size classes.
Large Text
(same size as h4)
1.2rem / 1.875rem
19.2px / 30px
Default Text
(same size as h5)
1rem / 1.5rem
16px / 24px
Small Text
(same size as h6)
0.8333333333rem / 1.3125rem
13.3333px / 21px
Tiny Text
0.6944444444rem / 1.125rem
11.1111px / 18px
Alignment classes
Easily realign text to components with text alignment classes.
Left aligned text.
Center aligned text.
Right aligned text.
Justified text.
No wrap text.
Word break classes
Use the following classes when overflow of text impedes user experience.
Word break with no symbols
Using .break-word will break a word at arbitrary points if there are no otherwise acceptable break points in the line. Generally only use when a word break symbol would cause misinterpretation, such as when breaking a long URL.
Word break with hyphens
Using .break-word-hyphens will break the word using a hyphen between the breaks.
Word break with ellipsis
Using .break-word-ellipsis will truncate the words that begin to overflow their container and will add an ellipsis. This option should only be used if the user can access all of the text through other means.
Note on ellipsis truncation usage
The ellipsis truncation class should be applied to a single line of text and must be applied to an inline-block element. If .break-word-ellipsis is applied to a block level element, the text will be limited to one line and no ellipsis will be shown.
Grid Examples
The examples below show a border to help illustrate the overflow problem with a long single word if no breaks are applied.
No symbols
Hyphens
Ellipsis
Default (no classes)
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Table Examples
Note on usage in tables
Because both the table and its cell will expand to fill its container based upon its content, word break classes will only work on a cell if the cell has a max-width set. The table will also need its width set to its initial value to ignore the default 100% width.
No symbols
Hyphens
Ellipsis
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Default (no classes)
Empty
Recyclingzwecken an Lexmark zurückzugeben. Tinte/Toner & Verbrauchsmaterialien. Rechtsschutzversicherungsgesellschaften
Transformation classes
Transform text in components with text capitalization classes.
Lowercased text.
Uppercased text.
Capitalized text.
Text thick and thin
Text thick and thin to beef up or slim down text.
Text bold.
Text semibold.
Text thick.
Text light.
Abbreviations
Stylized implementation of HTML's <abbr> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a title attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover and to users of assistive technologies.
Basic abbreviation
An abbreviation of the word attribute is attr.
Initialism
Add .initialism to an abbreviation for a slightly smaller font-size.
HTML is the best thing since sliced bread.
Addresses
Present contact information for the nearest ancestor or the entire body of work. Preserve formatting by ending all lines with <br>.
Twitter, Inc.
1355 Market Street, Suite 900
San Francisco, CA 94103
P: (123) 456-7890
Full Name first.last@example.com
Quotes
"Normal" Quotes
"Normal" quotes are part of the presented text, and aren't meant to be highlighted as more or less important than surrounding content.
John Doe said, CSS rocks big time!
Blockquotes
For quoting blocks of content from another source within your document.
Default blockquote
Wrap <blockquote> around any HTML as the quote. For straight quotes, we recommend a <p>.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Naming a source
Add a <footer> for identifying the source. Wrap the name of the source work in <cite> and order the Quotee Name, Title, and Company as seen below.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Reverse display
Add .blockquote-reverse for a blockquote with right-aligned content.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Side-bar color options
Add .border-b1 to <blockquote>, changing b1 to any color in our framework.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Text color options
Add .text-white to <blockquote>. If the default link color doesn't meet accessibility standards against the background color, add .text-white to <a>. Works with any color in our framework.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Lists
Unordered
A list of items in which the order does not explicitly matter.
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
A list of items in which the order does explicitly matter.
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
Unstyled
Remove the default list-style and left margin on list items (immediate children only). This only applies to immediate children list items, meaning you will need to add the class for any nested lists as well.
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
Condensed
Add .list-condensed to the <ul> to remove the bottom margin from each list item.
Lorem ipsum dolor sit amet
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
Inline
Place all list items on a single line with display: inline-block; and some light padding.
Lorem ipsum
Phasellus iaculis
Nulla volutpat
Description
A list of terms with their associated descriptions.
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.
Horizontal description
Make terms and descriptions in <dl> line up side-by-side. Starts off stacked like default <dl>s, but when the navbar expands, so do these.
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.
Felis euismod semper eget lacinia
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.