Dev Helpers

Tailwind CSS / Box model and sizing

Content-box sizing

Dev Helpers · July 16, 2026

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

Worked example

<div class="demo box-content w-48 p-4 border-4 border-teal-700">
  Content-box sizing
</div>

Implementation notes

Intrinsic content that grows after fonts load can change the required outer size. Reserve enough room if matching a fixed external frame.

Try it yourself

Add a border and verify the difference between content and outer dimensions.

Open the Tailwind CSS example →

Editorial date July 16, 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.

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.

Border-box sizing

The box-border utility keeps borders and padding inside a declared width. Use it where a local styling reset changes sizing conventions.