CSS Worksheet: Box Model
Code tip (Inside out, twice): From the inside out: content → padding → border → margin. Border to border = width + 2 × padding + 2 × border. Total space = width + 2 × padding + 2 × border + 2 × margin.
NameDateTime takenScore ___ / 40
- 1.True or false: the border is the line round the box. (a) True (b) False
- 2.Which of these is the border? (a) the line round the box (b) the gap to other boxes (c) the gap round content (d) space inside the border
- 3.Which of these is padding? (a) the line round the box (b) space inside the border (c) the gap to other boxes (d) space outside the border
- 4.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) the text or picture (d) the gap to other boxes
-
5.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 110px;
padding: 30px;
border: 4px solid black;
margin: 20px;
} -
6.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 60px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} - 7.True or false: padding is the line round the box. (a) False (b) True
-
8.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 180px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} -
9.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 270px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} -
10.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 200px;
padding: 15px;
border: 4px solid black;
margin: 5px;
} -
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} - 12.Which of these is padding? (a) a solid or dotted edge (b) the line round the box (c) the gap to other boxes (d) the gap round content
-
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
14.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 140px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} - 15.Which of these is margin? (a) space inside the border (b) space outside the border (c) the text or picture (d) a solid or dotted edge
- 16.Which of these is the content? (a) space outside the border (b) a solid or dotted edge (c) the line round the box (d) the text or picture
-
17.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} - 18.True or false: margin is space outside the border. (a) False (b) True
- 19.True or false: padding is a solid or dotted edge. (a) False (b) True
- 20.True or false: padding is space inside the border. (a) False (b) True
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} - 22.True or false: margin is a solid or dotted edge. (a) True (b) False
- 23.Which of these is margin? (a) the gap round content (b) the gap to other boxes (c) the text or picture (d) the line round the box
-
24.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 140px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 200px;
padding: 5px;
border: 5px solid black;
margin: 15px;
} - 26.True or false: margin is the line round the box. (a) False (b) True
-
27.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 190px;
padding: 15px;
border: 1px solid black;
margin: 20px;
} - 28.📦 In the box model, which part is the text or picture? (a) margin (b) content (c) border (d) padding
- 29.True or false: the content is space inside the border. (a) True (b) False
-
30.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 270px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 4px solid black;
margin: 5px;
} -
32.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 290px;
padding: 10px;
border: 5px solid black;
margin: 10px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} - 34.📦 In the box model, which part is the gap round content? (a) margin (b) border (c) padding (d) content
-
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 20px;
border: 2px solid black;
margin: 0px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 15px;
border: 5px solid black;
margin: 20px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 230px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} - 38.True or false: the content is a solid or dotted edge. (a) True (b) False
- 39.True or false: margin is space inside the border. (a) False (b) True
- 40.True or false: padding is space outside the border. (a) True (b) False
Answer key
- True
- the line round the box
- space inside the border
- a solid or dotted edge
- 178
- 110
- False
- 250
- 338
- 238
- 280
- the gap round content
- 168
- 174
- space outside the border
- the text or picture
- 198
- True
- False
- True
- 162
- False
- the gap to other boxes
- 168
- 250
- False
- 222
- content
- False
- 294
- 148
- 320
- 342
- padding
- 144
- 380
- 304
- False
- False
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids