Container

Also called max-width container, content wrapper, or page 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.

What is Container?

A container is the invisible box most websites put their content in. It has a max-width (often 1200 to 1280px), margin-inline: auto to center it, and side padding so content never touches the screen edge on phones. As the window grows wider than the max width, the empty space on both sides grows while the content stays put.

Without one, lines of text stretch across a wide monitor and become hard to read, and parts of the page drift apart. Use one container width across the site so the logo, headings, and footer line up on the same edges. A section’s background can still run the full width of the screen while its content sits in the container.

For long-form text, a narrower measure of about 65 characters (max-width: 65ch) reads more comfortably. Tailwind has a container class that snaps its max width to each breakpoint; many projects use mx-auto max-w-6xl px-6 instead to get one fixed width.

All terms

Responsive design

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

CSS Grid

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

Padding vs margin

Padding is the space inside an element’s border, around its content, while margin is the space outside the border that pushes other elements away.

Hero section

The large first section at the top of a landing page, with a headline, a short subhead, a call to action, and a visual.