Overview

Contents

Containers

Containers are the most basic layout element in Bootstrap and are required when using our default 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 all the time).

While containers can be nested, most layouts do not require a nested container.

<divclass="container"><!-- Content here --></div>

Use .container-fluid for a full width container, spanning the entire width of the viewport.

<divclass="container-fluid">
...
</div>

Responsive breakpoints

Since Bootstrap is developed to be mobile first, we use a handful of media queries to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.

// Example
// Apply styles starting from medium devices and up to extra large devices
@media(min-width:768px)and(max-width:1199px){...}

The Sass mixin for targeting the same screen size range would be:

@includemedia-breakpoint-between(md,xl){...}

Z-index

Several Bootstrap components utilize z-index, the CSS property that helps control layout by providing a third axis to arrange content. We utilize a default z-index scale in Bootstrap that’s been designed to properly layer navigation, tooltips and popovers, modals, and more.

We don’t encourage customization of these values; should you change one, you likely need to change them all.