What is CSS Box Model and what are its elements?

Member

ashtyn

by ashtyn , in category: Design , 2 months ago

What is CSS Box Model and what are its elements?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by oda.tromp , 2 months ago

The CSS box defines the design and the layout of elements of CSS. The several elements are:

Margin: the transparent area outside the border

Border: the padding and content option with a border around it is shown.

Padding: Space is around content. Padding is transparent.

Content: a box where text and images appear.

e.g.:

div{ width: 300px; border: 25px solid yellow; padding: 25px; margin: 25px; }