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