Simple Guide to Understanding a Bootstrap Grid System

coding using bootstrap grid

Before you can dive too deeply into a technology or development tool, you should have at least a high-level understanding of what the product is – or is not.

Bootstrap is a technology tool created as a front-end framework for developing web pages and applications. It has become one of the most popular tools referenced on the GitHub website, garnering in excess of 100,000 stars from users of Bootstrap functionality.

Some of the factors contributing to the success of Bootstrap are:

  • Price (it’s free to download)
  • Platform – Bootstrap is open source
  • Flexibility – it contains HTML and CSS templates for quickly designing buttons, forms, and other website content
  • Optional JavaScript extensions available
  • Broad acceptance and utilization by website and web application developers
  • Continuous additions to functionality and responsiveness to the developer community

With such a growing user base and many developer contributors to the product, it’s no wonder Bootstrap has experienced an amazing level of adoption for designing web applications and websites.

Functionality and Simplicity Combined

coding with red keyboard

Image via Pxhere

Bootstrap today serves as a full-featured development and web page design tool for developers of all skill levels.

By combining architectural features to support advancements in such in-demand technologies as Saas, JavaScript, and CSS with ease of use, Bootstrap has become one of the most recognized and popular frameworks for front-end website building.

The flexibility of Bootstrap lets you as a developer select the features and components that most suit the design of your web pages. Variables can be utilized for such functions as controlling padding, color, and settings of individual objects.

Bootstrap’s responsive design and grid-based functionality enable you to create multiple variations of web pages for use on low or high-resolution devices, whether developing for mobile devices, tablets, laptops, or PCs.

With its focus on a grid design, Bootstrap is a relatively easy tool to gain proficiency in, building full websites that adapt to the devices running your applications.

A Simple Guide to Understanding

the Bootstrap Grid System

The Grid Concept

Bootstrap builds your webpages utilizing a grid layout that you can utilize to format responsive web pages for multiple devices. The responsive attribute refers to the application recognizing the device in use, and resizing images appropriately.

In general, the Bootstrap grid is designed to facilitate a width of 12 columns, although you can group columns together creating fewer but wider columns, if your design does not call for all 12.

If you use more than 12 columns in your grid, Bootstrap will stack them. In addition, where a large display may accommodate 12 columns quite readily, small screens will provide better presentation when columns are stacked.


Options for Grid Classes

Bootstrap offers you multiple options in creating dynamic and responsive screen layouts:

  • Xl – for screens equal or greater than 1200px
  • Lg – for desktops and laptops with screens equal or greater than 992px width
  • Md – for smaller laptops with screen width equal or greater than 768px
  • Sm – stepping down to tablet-size screens equal or greater than 576px wide
  • Xs – sized for mobile devices such as phones, with screens less than 576px wide

Grid classes can be mixed to provide more flexibility in layout. Each class will also scale to the next larger class, so if you want to design a grid for small and medium display, you can simply specify small.

Basic Rules for Using Bootstrap Grids

There are a few specific rules to keep in mind when building grids with Bootstrap:

  • To assure the desired alignment and padding of rows, the rows must be placed in a .container-fluid (for full-width) or .container (fixed-width)
  • Your content must always be placed in columns
  • Columns must be the immediate children of rows
  • Rows can only be used to contain columns
  • If you attempt to provide over 12 columns on a grid, they will be stacked
  • Column widths are specified in percentages of total width, and are fluid, making them sized in relation to their parent elements
  • All rows should be placed in a container

Bootstrap provides predefined classes for quick generation of grids, such as .col-sm-4 and .row

How the Grid Works

coding with laptop

Image by Pixabay

Bootstrap’s grid is designed for responsive layout, utilizing the familiar concept of rows and columns.


Groupings of these rows and columns are placed in at least one container, but possibly more. In its simplest form, a grid can consist of a single container, with one row and column:

<div class=”container“>
<div class=”row“>
<div class=”col“>Here is the grid content!</div>

This example, of course, does not utilize the classes such as Flexbox, CSS, or JavaScript components.

The container is a key element of Bootstrap. It essentially controls the width of your layout and is the root of your grid. The container can contain any element of your layout – rows, columns, and other markup content.

You can include multiple containers on a page to suit your design preferences, and a container may contain multiple rows.

Proper use of containers will ensure optimal alignment on the page, due to the property of container padding that keeps rows aligned with 15px margins. Inserting rows without being included in a container will result in a horizontal scroll that you did not intend, and your viewers will not appreciate.

Inserting Your Content – Columns

Formatting your content is never done in the rows of the grid. Content is placed in columns, and columns are placed in the rows.

With Flexbox implementation in Bootstrap 4, both vertical and horizontal alignment are accomplished with Auto-margin and Flex Utility classes.

Columns are invaluable in your layout design for multiple reasons:

  • Columns can vary in width automatically for responsive design
  • Columns create the horizontal placement and division across the display
  • Can contain other rows and columns through nesting
  • Will always be the same height as other siblings in the row
  • Columns create the horizontal separation across the display or viewport

Space generated between columns are referred to as the gutter.

Columns in a row will be spread horizontally across the row. When you include over the base 12 columns of the grid, the remaining columns will be stacked or wrapped vertically down, referred to as “column wrapping.” This may or may not be the effect you desire for your web page.

Flexbox introduces a new term for columns – Auto-layout columns. Flexbox offers additional controls over the alignment and justification of columns for your page layout.


Mobile Comes First

As part of this simple guide to understanding the Bootstrap grid system, you should also be aware that Bootstrap inherently puts mobile presentation first. This makes perfect sense, as you take a look around to see how website users are accessing your web pages – on phones and tablets.

With a “mobile first” approach to responsive design, xs (the smallest px value) is the default breakpoint in building your grid. Keep in mind that higher breakpoints will override smaller values. Size your columns accordingly, perhaps defining 3 columns for sm, but 4 columns when designing for md or higher values.

Grid Design Considerations


When designing your grid layout, keep these concepts in mind:

On smaller screen widths, columns will stack vertically and maintain their full width, unless you incorporate a specific class within your HTML markup details. Using such a specification will eliminate the possibility of stacking that you did not intend.

Smaller classes specified on your grid also apply to larger screens, so you truly only need to specify the smallest device/display you intend to support on your web pages.

Your columns will be equal height in the same row. Multiple options can be used to control formatting details, including Flexbox justify and alignment functions, auto-margins, and vertical centering.

Browser Support

Utilizing a design tool like Bootstrap would be all but useless if your browser did not support the results of your design. This is certainly not an issue with Bootstrap. Your web pages will be supported by nearly every popular browser that hits your website:

Browser Support


Chrome, Firefox, Opera, Safari


Chrome, Firefox, Internet Explorer (10+), Microsoft Edge, Opera

Mobile Devices


Chrome, Firefox, Android Browser and WebView, Microsoft Edge


Chrome, Firefox, Safari, Microsoft Edge

A Brief History of Bootstrap

Initially developed by Jacob Thornton and Mark Otto as a framework to facilitate development for internal use at Twitter, Bootstrap (originally named Twitter Blueprint) grew from a tool to promote consistency in interface design into a full-function tool that was released in 2011 as an open source product for website developers.

Bootstrap 4 was released in January 2018, with an enhanced toolkit for developers that now supports the current migration to CSS flexbox and Sass.

Jacob, Mark, and a handful of developers continue to enhance and add functionality to Bootstrap, demonstrating their commitment to the on-going value of the product for current and prospective web developers.


Featured Image via Pxhere


What do you think?

Leave a Reply

Your email address will not be published.