What is CSS Box Model and what are its elements?

Member

by ashtyn , in category: Design , 3 years ago

What is CSS Box Model and what are its elements?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by oda.tromp , 3 years 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; }