You are here: Home / Topics / What is CSS Box Model and what are its elements?

What is CSS Box Model and what are its elements?

Filed under: CSS Interview Questions on 2022-07-02 15:20:34

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

Margin: transparent area outside border
Border: the padding and content option with a border around it is shown.
Padding: Space is around content. Padding is transparent.
Content: box where text and images appear.
e.g.:

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

About Author:
D
Dharmendra Sir     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.