The CSS Box Model is a box that wraps around every HTML element. It consists of the following parts:
This box demonstrates the CSS Box Model. Modify the code in the CSS to see the changes!
The box above has the following properties:
box-sizing
In CSS, the default value of box-sizing
is content-box, meaning the width and height of an element only apply to the content area. If you want the width and height to include the padding and border, you need to use box-sizing: border-box;.
1. Which part of the CSS Box Model is outside of the border?
2. What is the default value of box-sizing
?
3. If you set box-sizing: border-box;
, what happens to the width and height of an element?