HTML CSS

ADD BOX AROUND TEXT IN HTML CSS

<div style="background: ghostwhite;                     font-size: 20px;                     padding: 10px;                     border: 1px solid lightgray;                     margin: 10px;">   TEXT </div>

JUST ADD PADDING BORDER

01

CONTENT

PADDING

BORDER

MARGIN

Nearly all HTML elements are rendered according to the CSS box model. Go ahead - Set different sizes for each layer and test it for yourself.

THE BOX MODEL

02