Skip to content

CSS Layout — Flexbox & Grid

Every design decision you make eventually comes down to one question: where does this element go? Layout is the answer. It is the invisible system that holds your entire interface together — the same way a grid system in Figma keeps every screen consistent.

The good news for designers: CSS layout is not magic. It maps almost one-to-one to tools you already use in Figma every day.

CSSFigma equivalentBest for
FlexboxAuto LayoutArranging items in a single row or column
CSS GridLayout GridBuilding two-dimensional layouts (rows AND columns at once)

Think of Flexbox as the tool you reach for when you need items in a line — a navigation bar, a row of cards, a centered button. Think of CSS Grid as the tool for the overall page scaffold — headers, sidebars, main content areas, footer.

You will use both constantly. Most real UIs use Grid for the big picture structure and Flexbox for the small-scale component layout inside each region.

Below are three boxes. Right now they are stacked vertically because that is how the browser arranges block elements by default. Try changing display: block to display: flex in the CSS panel and watch what happens.

Try display: flex — the boxes line up in a row. Try display: grid with grid-template-columns: repeat(3, 1fr) — they sit in a three-column grid. You just used the two most important layout tools in CSS.

LessonWhat you will be able to do
Display & FlowUnderstand how browsers stack elements by default
FlexboxAlign rows and columns of components precisely
GridBuild full-page two-dimensional layouts
PositioningControl elements that break out of normal flow
Spacing SystemsApply consistent spacing using a design scale

By the end, every Figma auto-layout frame and every layout grid you have ever built will have a direct CSS translation you can write from memory.

Which CSS layout tool is closest to Figma Auto Layout?
What is CSS Grid best suited for compared to Flexbox?
What property do you set on a parent element to activate Flexbox?