CSS Layout Playground

display: inline-block

This is one of the older methods for layout. It's a hybrid between `inline` (like words in a sentence) and `block` (like paragraphs).

CSS Editor

Live Preview

display: flex (Flexbox)

Flexbox is a modern, powerful 1-Dimensional (1D) layout system. It's designed to align and distribute items in a single row OR a single column.

Analogy: Think of it as a smart bookshelf. You can tell it to stack books vertically (`flex-direction: column`) or line them up horizontally (`flex-direction: row`). You can also tell it how to space them out (`justify-content`).

CSS Editor

Live Preview

display: grid (CSS Grid)

CSS Grid is the most powerful and modern layout system. It is 2-Dimensional (2D), meaning it controls layout in both rows AND columns at the same time.

Analogy: Think of it as a spreadsheet, a chessboard, or a muffin tin. You define the grid (e.g., "I want 3 columns and 2 rows"), and then you place your items into the "cells" you've created.

CSS Editor

Live Preview