property-value

Box sizing/content box — CSS reference

Applies declared width to content only, adding padding and borders outside that width. With 100px width, 10px padding and 5px borders on both sides, the rendered border-box width is 130px.

Formal Syntax & Structure

css syntaxcss
box-sizing: content-box;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>box-sizing/content-box</title><style>body{margin:8px;background:white;color:black;font:16px/20px sans-serif}*{box-sizing:content-box}#a{width:100px;padding:10px;border:5px solid blue;box-sizing:content-box}</style><body><div id="a">Example text</div></body></html>
CSS Reference