CSS Box Model
Question?
Using an annotated diagram to illustrate your answer, describe the CSS box model.
Answer:–
All HTML elements can be considered as boxes.
In CSS, the term “box model” is used when talking about design and layout.
The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders,
padding, and the actual content.
The box model allows us to place a border around elements and space elements in relation to other elements.
- Margin - Clears an area around the border. The margin does not have a background colour, and it is completely transparent
- Border - A border that lies around the padding and content. The border is affected by the background colour of the box
- Padding - Clears an area around the content. The padding is affected by the background colour of the box
- Content - The content of the box, where text and images appear
Posted by: martin Last updated on:2010-08-04 20:36:40
Tag:- layout