Breakpoints

Bootstrap including wrapping containers, a powerful grid system, a flexible media object, and responsive utility classes.

Containers

Containers are the most basic layout element in Bootstrap and are required when using our grid system. Choose from a responsive, fixed-width container (meaning its max-width changes at each breakpoint) or fluid-width (meaning it’s 100% wide).

<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

These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.

// Extra small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }
@include media-breakpoint-up(xs) { ... }

// Small devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
@include media-breakpoint-up(sm) { ... }

// Medium devices (desktops, 992px and up)
@media (min-width: 992px) { ... }
@include media-breakpoint-up(md) { ... }

// Large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
@include media-breakpoint-up(lg) { ... }

// Extra large devices (large desktops, 1400px and up)
@media (min-width: 1400px) { ... }
@include media-breakpoint-up(xl) { ... }

We occasionally use media queries that go in the other direction (the given screen size or smaller):

// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575px) { ... }
@include media-breakpoint-down(xs) { ... }

// Small devices (landscape phones, less than 768px)
@media (max-width: 767px) { ... }
@include media-breakpoint-down(sm) { ... }

// Medium devices (tablets, less than 992px)
@media (max-width: 991px) { ... }
@include media-breakpoint-down(md) { ... }

// Large devices (desktops, less than 1200px)
@media (max-width: 1199px) { ... }
@include media-breakpoint-down(lg) { ... }

// Extra large devices (large desktops, less than 1400px)
@media (max-width: 1400px) { ... }
@include media-breakpoint-down(xl) { ... }

We also have media between the breakpoint’s minimum and maximum widths for only the given screen size:

// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575px) { ... }
@include media-breakpoint-only(xs) { ... }

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767px) { ... }
@include media-breakpoint-only(sm) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991px) { ... }
@include media-breakpoint-only(md) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) and (max-width: 1199px) { ... }
@include media-breakpoint-only(lg) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) and (max-width: 1400px) { ... }
@include media-breakpoint-only(xl) { ... }

And finally media that spans multiple breakpoint widths:

// Medium devices (tablets, 768px and up) and  Large devices (desktops, 992px and up)
@media (min-width: 768px) and (max-width: 1199px) { ... }
@include media-breakpoint-between(md, lg) { ... }