box-sizing

Defines what the width and height of an element include. This property decides whether padding and border are added to the size you declared or are part of it.
  • content-box (default): width and height only measure the content; padding and border are added outside.
  • border-box: width and height include content, padding and border, so the final size is exactly the declared one.

Example

Both children have the same width, padding and border. Change box-sizing on the item class and compare its final size with the reference child.

Select box-sizing:
ResultLive
html
css