⊗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 */ }

:

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline