Responsive design

Also called responsive layout, responsive web design, or mobile-friendly design

Designing one layout that adapts to any screen width, rearranging columns, sizes, and navigation at set widths called breakpoints.

What is Responsive design?

A responsive page reflows to fit the screen it is on. Three columns of cards on a laptop become two on a tablet and one on a phone, a row of navigation links becomes a menu button, and large headings scale down. The widths where the layout changes are called breakpoints.

Tailwind’s default breakpoints are sm 640px, md 768px, lg 1024px, xl 1280px, and 2xl 1536px. They are mobile-first: classes without a prefix apply at every size, and md:grid-cols-2 takes effect from 768px up. In plain CSS the same idea is a @media (min-width: 768px) rule.

Design for the phone first, since it has the tightest space, then add columns as room appears. Test the widths between your breakpoints too, because that is where layouts often break. Container queries (@container) go a step further: a component responds to the width of its parent, so the same card can adapt inside a sidebar or a wide grid.

All terms

CSS Grid

A CSS layout system that places items on rows and columns at once, so content lines up in both directions.

Container

A wrapper that caps content at a maximum width and centers it, so lines stay readable on wide screens and keep padding on small ones.

Flexbox

A CSS layout mode that lines items up in a row or a column and controls how they share space, align, and wrap.

Above the fold

The part of a page visible before anyone scrolls, ending at the fold: the bottom edge of the screen, which moves with every screen size.