Bootstrap 5.3 · hands-on

Layout Playground.

Flip a setting, watch the layout move, copy the code. Every screen below follows Bootstrap 5.3's own rules, so the class names you copy work on a real Bootstrap page.

LAB 1

Flexbox: line things up

The dashed box is the flex container (it has d-flex). The colored boxes are its items. justify-content moves items along the main axis, align-items moves them along the cross axis.

Direction · flex-*
Main axis · justify-content-*
Cross axis · align-items-*
Space between · gap-*
Number of items
4
preview

LAB 2

Rows and columns: Bootstrap's grid

Every row is split into 12 units (the gray ruler). Give each column a size per screen width, then drag the screen size and watch the layout reshuffle. A class like col-md-6 means "6 units wide from tablet size up."

Quick layouts
Columns (size at each screen width)
All sizesmd ≥768lg ≥992
Gutter · g-*
Row: horizontal · justify-content-*
Row: vertical · align-items-*
Wrapper
Screen width
1024px

LAB 3

Styling with utility classes

Bootstrap ships hundreds of tiny one-job classes. Stack them on an element instead of writing CSS. Tip: style a box inside a column, never the col itself, so the gutters stay intact.

Padding · p-*
Background · bg-*
Text color · text-*
Border · border
Corners · rounded-*
Shadow · shadow-*
preview
    LAB 4

    CSS Grid: rows and columns at once

    Plain CSS, no Bootstrap classes. You describe the column tracks and the items fill the cells left to right, top to bottom. fr means "one share of the free space."

    Columns · grid-template-columns
    Gap · gap
    Number of items
    6
    preview