What is the use of the Box Model in CSS and what are its elements?
Question :
What is the use of the Box Model in CSS and what are its elements?
In CSS, the box model is a box that binds all the html elements and it includes features like margins, border, padding and the content.
Margin: the top most layer, the overall structure showed.
Border: the padding and content option with a border around is shown. Background color affects the border.
Padding: space showed. Background color affects the border.
Content: Actual content is showed.
By using a box model we will get the authority to add the borders all around the elements and we can also define the space between the elements.