Bootstrap Grid System Basics

Bootstrap Framework 10 min min read Updated: Nov 16, 2026 Beginner
Bootstrap Grid System Basics
Beginner Topic 1 of 7

What is the Grid System?

The grid system is the most important part of Bootstrap. It helps you arrange content in rows and columns, like a table, but much more flexible and responsive.

Simple example: Imagine a chocolate bar divided into 12 equal pieces. You can take 6 pieces for one part and 6 for another, or 4 + 4 + 4, or 3 + 9. Bootstrap's grid works exactly like this.

The Three Building Blocks

PartClassJob
Container.containerWraps and centers the whole layout
Row.rowA horizontal group of columns
Column.colHolds your content, takes a share of 12 parts

Your First Grid

html <div class="container"> <div class="row"> <div class="col">Column 1</div> <div class="col">Column 2</div> <div class="col">Column 3</div> </div> </div>
Result

Three equal-width columns side by side. Each column takes one-third of the row.

Setting Column Sizes

Write col- followed by a number from 1 to 12 to say how many parts the column should take.

html <div class="row"> <div class="col-4">4 parts</div> <div class="col-8">8 parts</div> </div>
ClassWidth
col-12100% (full row)
col-650% (half)
col-433.33% (one third)
col-325% (one quarter)
col-216.66%
col-18.33%

The Rule of 12

The numbers in one row should add up to 12. If you use more than 12, the extra column moves to the next line (this is called wrapping).

html <div class="row"> <div class="col-8">8</div> <div class="col-4">4</div> <!-- total 12, fits --> <div class="col-6">6</div> <!-- starts a new line --> </div>

Seeing the Grid Clearly

While learning, add a border and background to the columns so that you can see them:

html <div class="container text-center"> <div class="row"> <div class="col border bg-light p-3">One</div> <div class="col border bg-light p-3">Two</div> </div> </div>

Why Do We Need a Row?

Columns must always be placed directly inside a .row. The row removes the extra padding of the container using negative margins, which keeps your columns perfectly aligned. Without a row the layout will look uneven.

Common Mistakes

  • Putting columns directly inside a container without a row
  • Using a wrong total, like col-5 + col-5 + col-5, and getting an unexpected line break
  • Placing text directly inside .row instead of inside a column
  • Forgetting that the grid has 12 columns, not 10 or 16
Practice: Create a row with col-3, col-6 and col-3. Then make it col-2, col-8, col-2 to see how the middle column grows.

Conclusion

The grid is a simple idea: container, row, columns and a total of 12 parts. Once you are comfortable with it, you can build almost any page layout.

Quick Summary: Container wraps, row groups, columns take parts of 12. Wrap to a new line when the total passes 12.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators