concept
border-box — CSS reference
The border edge encloses content, padding and border. For a single untransformed box getBoundingClientRect measures that rectangle, not margins. Transforms and fragmentation change the API result.
Formal Syntax & Structure
css syntaxcss
content area + padding + borderWorking Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS box geometry lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}#a{box-sizing:content-box;width:100px;height:40px;padding:10px;border:5px solid #254c55;margin:20px;display:flow-root} #a span{display:block;width:100%;height:100%}</style><body><div id="a" class="sample"><span id="b">Content</span></div></body></html>