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 content is space inside the border. (a) False (b) True
- 2.True or false: the content is space outside the border. (a) True (b) False
- 3.True or false: margin is the text or picture. (a) True (b) False
- 4.True or false: the border is a solid or dotted edge. (a) True (b) False
- 5.📦 In the box model, which part is space outside the border? (a) border (b) content (c) padding (d) margin
- 6.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
- 7.Which of these is padding? (a) a solid or dotted edge (b) space inside the border (c) the line round the box (d) the gap to other boxes
- 8.True or false: the content is the line round the box. (a) True (b) False
- 9.True or false: padding is the gap to other boxes. (a) False (b) True
-
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 30px;
border: 5px solid black;
margin: 10px;
} - 11.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) padding (d) border
- 12.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) border (d) margin
- 13.📦 In the box model, which part is the text or picture? (a) border (b) margin (c) padding (d) content
- 14.Which of these is padding? (a) space outside the border (b) the gap round content (c) the line round the box (d) the gap to other boxes
-
15.📦 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: 5px;
border: 4px solid black;
margin: 0px;
} -
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} - 17.True or false: the border is space inside the border. (a) True (b) False
-
18.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 280px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} -
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 1px solid black;
margin: 15px;
} -
20.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 15px;
border: 2px solid black;
margin: 10px;
} - 21.True or false: the content is the text or picture. (a) False (b) True
-
22.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 220px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 23.Which of these is margin? (a) space outside the border (b) the text or picture (c) a solid or dotted edge (d) the line round the box
-
24.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} -
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 1px solid black;
margin: 15px;
} -
27.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 10px;
border: 1px solid black;
margin: 5px;
} -
28.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 5px;
border: 2px solid black;
margin: 0px;
} - 29.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) border (d) margin
-
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 30px;
border: 1px solid black;
margin: 15px;
} -
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: 230px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} -
33.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 250px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 34.True or false: padding is the text or picture. (a) False (b) True
- 35.Which of these is the content? (a) a solid or dotted edge (b) space inside the border (c) the text or picture (d) the line round the box
-
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 4px solid black;
margin: 15px;
} -
37.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 100px;
padding: 25px;
border: 5px solid black;
margin: 5px;
} -
38.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 80px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} - 39.True or false: padding is a solid or dotted edge. (a) True (b) False
- 40.True or false: margin is space inside the border. (a) True (b) False
Answer key
- False
- False
- False
- True
- margin
- border
- space inside the border
- False
- False
- 150
- padding
- border
- content
- the gap round content
- 208
- 162
- False
- 312
- 132
- 124
- True
- 266
- space outside the border
- 266
- 114
- 382
- 92
- 74
- padding
- 232
- 172
- 262
- 296
- False
- the text or picture
- 128
- 160
- 98
- False
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids