Dev Helpers

Tailwind CSS / Box model and sizing

Border-box sizing

Dev Helpers · June 25, 2026

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

Worked example

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

Implementation notes

Width calculations are easier to verify with a visible border. Compare the computed border-box and content-box dimensions in the browser inspector.

Try it yourself

Add padding to a percentage-width column and compare its outer width.

Open the Tailwind CSS example →

Editorial date June 25, 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.