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.Which of these is the content? (a) the gap round content (b) the gap to other boxes (c) space outside the border (d) the text or picture
- 2.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) margin (d) content
- 3.Which of these is padding? (a) the text or picture (b) the gap to other boxes (c) the gap round content (d) the line round the box
-
4.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 20px;
border: 3px solid black;
margin: 0px;
} - 5.True or false: the content is the gap round content. (a) True (b) False
-
6.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 60px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} - 7.Which of these is the border? (a) the gap round content (b) the gap to other boxes (c) the text or picture (d) a solid or dotted edge
-
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: 50px;
padding: 5px;
border: 4px solid black;
margin: 10px;
} - 9.True or false: margin is space inside the border. (a) False (b) True
- 10.True or false: padding is a solid or dotted edge. (a) True (b) False
-
11.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
12.📦 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: 25px;
border: 3px solid black;
margin: 15px;
} -
13.📦 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: 25px;
border: 1px solid black;
margin: 5px;
} -
14.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
15.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} - 16.Which of these is padding? (a) space inside the border (b) a solid or dotted edge (c) the gap to other boxes (d) the line round the box
-
17.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 240px;
padding: 5px;
border: 4px solid black;
margin: 20px;
} - 18.True or false: the content is the text or picture. (a) False (b) True
- 19.📦 In the box model, which part is space outside the border? (a) margin (b) content (c) border (d) padding
-
20.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 90px;
padding: 20px;
border: 4px solid black;
margin: 15px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} - 22.True or false: padding is the gap round content. (a) False (b) True
-
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 30px;
border: 2px solid black;
margin: 5px;
} -
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: 160px;
padding: 25px;
border: 3px solid black;
margin: 10px;
} - 25.Which of these is margin? (a) the gap to other boxes (b) the line round the box (c) the text or picture (d) the gap round content
- 26.True or false: the border is space inside the border. (a) True (b) False
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} -
28.📦 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: 25px;
border: 3px solid black;
margin: 0px;
} -
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} -
30.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
31.📦 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: 5px solid black;
margin: 5px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 210px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} -
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: 130px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 5px;
border: 3px solid black;
margin: 0px;
} - 36.True or false: the border is the gap to other boxes. (a) False (b) True
- 37.Which of these is the border? (a) the gap to other boxes (b) the gap round content (c) space inside the border (d) the line round the box
- 38.Which of these is margin? (a) the gap round content (b) space outside the border (c) a solid or dotted edge (d) the text or picture
-
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
40.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 110px;
padding: 20px;
border: 5px solid black;
margin: 15px;
}
Answer key
- the text or picture
- content
- the gap round content
- 86
- False
- 102
- a solid or dotted edge
- 68
- False
- False
- 124
- 256
- 252
- 344
- 316
- space inside the border
- 258
- True
- margin
- 138
- 158
- True
- 124
- 216
- the gap to other boxes
- False
- 142
- 166
- 386
- 94
- 210
- 270
- 186
- 148
- 286
- False
- the line round the box
- space outside the border
- 290
- 190
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids