Dev Helpers

Tailwind CSS / Box model and sizing

Width that follows content

Dev Helpers · January 23, 2026

Intrinsic-width utilities allow a chip to follow its label. Long labels still need a wrapping or overflow policy.

Worked example

<div class="demo w-fit px-4 py-2">Width that follows content</div>

Implementation notes

The wrapping behaviour of neighbouring flex items can change how much space a chip receives. Inspect the chip in its real parent layout.

Try it yourself

Test the same chip with a single character and a long sentence.

Open the Tailwind CSS example →

Editorial date January 23, 2026 · Published December 6, 2026

Related articles

Maximum reading width

A max-width utility constrains a reading column even when its parent occupies the whole viewport. Font size still determines how many characters fit.

Content-box sizing

The box-content utility deliberately sizes the inner area. This can help when reproducing a measured content region with a separate frame.

Minimum inline size

Minimum width belongs to the element that must remain usable. A minimum on a parent can unnecessarily force the entire page to scroll.