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.📦 In the box model, which part is space inside the border? (a) padding (b) content (c) margin (d) border
- 2.Which of these is padding? (a) the gap to other boxes (b) space outside the border (c) a solid or dotted edge (d) space inside the border
- 3.📦 In the box model, which part is the line round the box? (a) border (b) content (c) margin (d) padding
- 4.True or false: margin is a solid or dotted edge. (a) False (b) True
-
5.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 160px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} - 6.📦 In the box model, which part is the gap round content? (a) content (b) border (c) margin (d) padding
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 15px;
border: 4px solid black;
margin: 10px;
} -
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: 160px;
padding: 20px;
border: 1px solid black;
margin: 5px;
} - 9.Which of these is the border? (a) the line round the box (b) the text or picture (c) space outside the border (d) the gap round content
-
10.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
11.📦 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: 10px;
border: 4px solid black;
margin: 5px;
} - 12.True or false: padding is space inside the border. (a) True (b) False
- 13.Which of these is the border? (a) space outside the border (b) the gap round content (c) a solid or dotted edge (d) the gap to other boxes
-
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} - 15.True or false: the content is the text or picture. (a) False (b) True
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} - 17.True or false: padding is the line round the box. (a) False (b) True
- 18.True or false: the content is space inside the border. (a) False (b) True
- 19.True or false: padding is the text or picture. (a) True (b) False
-
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 15px;
border: 1px solid black;
margin: 10px;
} -
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 20px;
border: 2px solid black;
margin: 15px;
} -
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 10px;
border: 4px solid black;
margin: 15px;
} - 23.True or false: padding is the gap round content. (a) False (b) True
-
24.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 30px;
border: 1px solid black;
margin: 10px;
} -
25.📦 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: 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: 30px;
border: 1px solid black;
margin: 20px;
} -
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: 110px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} - 28.Which of these is padding? (a) the line round the box (b) the gap to other boxes (c) the gap round content (d) the text or picture
- 29.Which of these is margin? (a) the line round the box (b) a solid or dotted edge (c) the text or picture (d) space outside the border
- 30.True or false: the border is the gap to other boxes. (a) True (b) False
- 31.📦 In the box model, which part is the text or picture? (a) content (b) padding (c) border (d) margin
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 1px solid black;
margin: 5px;
} -
33.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} - 34.📦 In the box model, which part is the gap to other boxes? (a) border (b) padding (c) margin (d) content
- 35.True or false: the border is the line round the box. (a) True (b) False
- 36.True or false: the content is the gap to other boxes. (a) True (b) False
- 37.Which of these is the content? (a) the text or picture (b) space outside the border (c) the gap to other boxes (d) a solid or dotted edge
-
38.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 30px;
border: 5px solid black;
margin: 15px;
} - 39.True or false: margin is the gap to other boxes. (a) False (b) True
-
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 4px solid black;
margin: 0px;
}
Answer key
- padding
- space inside the border
- border
- False
- 218
- padding
- 128
- 202
- the line round the box
- 278
- 108
- True
- a solid or dotted edge
- 250
- True
- 194
- False
- False
- False
- 252
- 134
- 248
- True
- 212
- 234
- 402
- 138
- the gap round content
- space outside the border
- False
- content
- 312
- 88
- margin
- True
- False
- the text or picture
- 210
- True
- 228
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids