DEV Community

sutharrahul
sutharrahul

Posted on

Box Model

Box model is really useful because when we add height, weight, margin or padding to element than appears bigger than we set if we don't use box model. because calculation of element size is "height + padding + border = actual height of an element" width + padding +border = actual width of element"
if we don't use box sizing than div will be bigger. but If you set box-sizing: border-box; on an element, padding and border are included in the width and height

Top comments (0)