Layout & CSS More detail A2 · Formal specification Platform: Web

max-content

`max-content` is the size content would like if it did not wrap at normal break points.

See how it works
You might call it maximum intrinsic sizemax-content contribution

See how it works

Original worked examplemax-content

Another example

A command panel uses `max-content` for the shortcut column, so “⌘ Shift P” stays on one line. The command name uses `minmax(0,1fr)` and shortens only when the dialog reaches its viewport limit. A long translation cannot make the dialog wider than that limit.

Main parts

  1. 01Unwrapped content
  2. 02Preferred intrinsic size
  3. 03Outer size constraint

Use it when

Use it when one-line content matters and an outer limit keeps the box from growing too wide.

Do not use it when

Do not use it for long reading text, user-written text, or a box with no width limit. It may overflow the viewport.

Name used in code

width: max-content or a max-content grid track

Before you ship

Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience.

Request you can copy

Outcome: Use or define max-content to make the visual experience clear and easy to use. User context: A command panel uses `max-content` for the shortcut column, so “⌘ Shift P” stays on one line. The command name uses `minmax(0,1fr)` and shortens only when the dialog reaches its viewport limit. A long translation cannot make the dialog wider than that limit. Design concept to apply: max-content. Why it fits: Use it when one-line content matters and an outer limit keeps the box from growing too wide. Do not use it when: Do not use it for long reading text, user-written text, or a box with no width limit. It may overflow the viewport. Design requirements: Set the content order, shared design values, and reusable components. Define how the layout changes by screen size and state. Keep useful design choices separate from decoration. Inclusion and resilience: Check contrast, zoom, languages, themes, and reduced motion when needed. Do not use color or effects as the only way to show meaning. Acceptance criteria: The design stays clear on phones and desktops, at zoom, in every theme, and in all supported languages. Interactive states stay clear and consistent. Evidence and limits (evidence boundary): A formal document may still be a draft, release candidate, or final version. Check its status and browser or platform support. Unknowns to confirm: Brand limits, amount of content, supported themes and languages, target devices, and design-system rules.

Check this request

Review the current use of max-content. Definition: `max-content` is the size content would like if it did not wrap at normal break points. Release checks: Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.

A2
How official is this term?

Formal specification

A published, versioned formal specification defines this term for the listed technical scope.

A formal document may still be a draft, release candidate, or final version. Check its status and browser or platform support.

Scope
CSS max-content size
Document status
draft
Checked on
2026-07-30

Evidence sources & scope

Authority source + Term reference · W3C CSS Working Group · draft CSS Box Sizing Module Level 3 — max-content size max-content size Scope: Intrinsic and extrinsic CSS sizing; direct scope: max-content size Role here: Direct term reference Source covers: canonical name, definition, semantics, implementation Authority source · W3C CSS Working Group · draft CSS Box Sizing Module Level 3 Scope: Intrinsic and extrinsic CSS sizing Role here: Authority within stated scope Source covers: canonical name, definition, semantics, implementation

Copy it yourself

The browser could not copy this. Select the request below and copy it yourself.