Skip to content

Layering & Overlap

Most people think Grid is rows and columns.

It’s also layers.

Multiple grid items can occupy the same cells — and that’s not a mistake.
That’s how you build:

  • hero overlays
  • badges
  • callouts
  • stacked UI panels

Two or more items can share the same grid area.

.hero {
display: grid;
}
.hero img {
grid-area: 1 / 1;
}
.hero .overlay {
grid-area: 1 / 1;
}

Same cells. Different layers.


Grid doesn’t invent stacking rules — it uses normal CSS stacking.

.overlay {
z-index: 2;
}

Positioning is optional.
Grid items stack naturally when they overlap.


Students reach for position: absolute.

That works — but you lose:

  • intrinsic sizing
  • grid alignment
  • responsive flow

Grid overlap keeps everything in the layout system.


Toggle overlap.
Raise layers.
See how grid stays intact.


Grid isn’t just structure.

It’s controlled chaos — with rules.


📘 Layering Items Study Guide (PDF)

📘 Layering Items Infographic (PNG)

Infographic explaining CSS Flexbox direction and axes, showing how flex-direction defines the main axis and cross axis, with visual examples for row, row-reverse, column, and column-reverse, and how justify-content and align-items map to each axis.

⏭ Together at Last: Grid & Flexbox Unite

Section titled “⏭ Together at Last: Grid & Flexbox Unite”

It’s not a competition. Grid and Flex work together.