The default grid system provided in Bootstrap utilizes 12 columns that render out at widths of 724px, 940px (default without responsive CSS included), and 1170px. Below 767px viewports, the columns become fluid and stack vertically.
......
As shown here, a basic layout can be created with two "columns", each spanning a number of the 12 foundational columns we defined as part of our grid system.
......
With the static (non-fluid) grid system in Bootstrap, nesting is easy. To nest your content, just add a new .row
and set of .span*
columns within an existing .span*
column.
Nested rows should include a set of columns that add up to the number of columns of it's parent. For example, two nested .span3
columns should be placed within a .span6
.
Level 1 columnLevel 2Level 2
The default and simple 940px-wide, centered layout for just about any website or page provided by a single Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries. Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included: To ensure devices display responsive pages properly, include the viewport meta tag. Bootstrap doesn't automatically include these media queries, but understanding and adding them is very easy and requires minimal setup. You have a few options for including the responsive features of Bootstrap: Why not just include it? Truth be told, not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it. For faster mobile-friendly development, use these basic utility classes for showing and hiding content by device. Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation. For example, you might show a Shown here is a table of the classes we support and their effect on a given media query layout (labeled by device). They can be found in Resize your browser or load on different devices to test the above classes. Green checkmarks indicate that class is visible in your current viewport. Here, green checkmarks indicate that class is hidden in your current viewport.
Fluid layout
Responsive design Media queries for various devices and resolutions
What they do
min-width
and max-width
.
Supported devices
Label
Layout width
Column width
Gutter width
Smartphones
480px and below
Fluid columns, no fixed widths
Smartphones to tablets
767px and below
Fluid columns, no fixed widths
Portrait tablets
768px and above
42px
20px
Default
980px and up
60px
20px
Large display
1200px and up
70px
30px
Requires meta tag
Using the media queries
/* Landscape phones and down */
@media (max-width: 480px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }
/* Large desktop */
@media (min-width: 1200px) { ... }
Responsive utility classes
What are they
When to use
element for nav on mobile layouts, but not on tablets or desktops.
Support classes
responsive.less
.
Class
Phones 480px and below
Tablets 767px and below
Desktops 768px and above
.visible-phone
Visible
Hidden
Hidden
.visible-tablet
Hidden
Visible
Hidden
.visible-desktop
Hidden
Hidden
Visible
.hidden-phone
Hidden
Visible
Visible
.hidden-tablet
Visible
Hidden
Visible
.hidden-desktop
Visible
Visible
Hidden
Test case
Visible on...
Hidden on...