Responsive design
Enabling responsive features
Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the
of your document. If you’ve compiled Bootstrap from the Customize page, you need only include the meta tag.<meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
Bootstrap doesn’t include responsive features by default at this time as not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it as needed.
About responsive Bootstrap
Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.
- Modify the width of column in our grid
- Stack elements instead of float wherever necessary
- Resize headings and text to be more appropriate for devices
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.
Supported devices
Label | Layout width | Column width | Gutter width |
---|---|---|---|
Large display | 1200px and up | 70px | 30px |
Default | 980px and up | 60px | 20px |
Portrait tablets | 768px and above | 42px | 20px |
Phones to tablets | 767px and below | Fluid columns, no fixed widths | |
Phones | 480px and below | Fluid columns, no fixed widths |
/* Large desktop */ @media (min-width: 1200px) { ... } /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { ... } /* Landscape phone to portrait tablet */ @media (max-width: 767px) { ... } /* Landscape phones and down */ @media (max-width: 480px) { ... }
Responsive utility classes
Class
|
Phones 767px and below | Tablets 979px to 768px | Desktops Default |
---|---|---|---|
.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 |