⊗mkPmBMPBEEE 137 of 250 menu

How padding and border affect the expansion of elements in CSS

If a block has both padding and a border, they will both expand the block:

<div id="elem1"></div> <div id="elem2"></div> #elem1 { width: 100px; height: 100px; background: #f1f1f1; margin-bottom: 20px; } #elem2 { width: 100px; height: 100px; background: #f1f1f1; padding: 25px; /* set indents */ border: 10px solid green; /* set the boundary */ }

:

azbydeenesfrkakkptruuz