Overview
Components and options for defining the layout of your project, such as containers, a grid system, a flexible media object and responsive utility classes.
Containers
Containers are the most basic layout element and are required when using the default grid system. Choose from a responsive, fixed-width container (meaning its max-width
changes at each responsive breakpoint) or fluid-width (meaning it’s 100%
wide all the time).
<div class="container">
<!-- Content here -->
</div>
Use .container-fluid
for a full width container, spanning the entire width of the viewport.
<div class="container-fluid">
<!-- Content here -->
</div>
Responsive breakpoints
In order to achieve a mobile-first approach, a handful of media queries is used to create sensible breakpoints for layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow for scaling up elements as the viewport changes. The following media query ranges - or breakpoints - are used for the layout, grid system and components.
// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
These translate to the following breakpoints: xs
, sm
, md
, lg
and xl
. Use these in classes that support responsive behavior, such as .col-md-6
and .d-xs-block
.