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 margin? (a) space inside the border (b) the gap to other boxes (c) the gap round content (d) the line round the box
- 2.📦 In the box model, which part is space outside the border? (a) content (b) border (c) padding (d) margin
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} - 4.Which of these is padding? (a) space inside the border (b) the gap to other boxes (c) space outside the border (d) the text or picture
- 5.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) margin (d) border
-
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} -
7.📦 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: 10px;
border: 2px solid black;
margin: 20px;
} - 8.Which of these is the border? (a) space inside the border (b) the line round the box (c) space outside the border (d) the gap round content
- 9.True or false: padding is the line round the box. (a) True (b) False
-
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: 230px;
padding: 15px;
border: 2px solid black;
margin: 5px;
} - 11.True or false: the border is a solid or dotted edge. (a) True (b) False
-
12.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 200px;
padding: 10px;
border: 1px solid black;
margin: 20px;
} -
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: 240px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} - 14.True or false: the border is space inside the border. (a) True (b) False
-
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: 80px;
padding: 30px;
border: 1px solid black;
margin: 5px;
} - 16.Which of these is the border? (a) a solid or dotted edge (b) the gap round content (c) the gap to other boxes (d) space inside the border
- 17.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) padding (d) content
- 18.True or false: the border is the text or picture. (a) True (b) False
-
19.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 5px;
border: 5px solid black;
margin: 0px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 5px solid black;
margin: 5px;
} -
21.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 80px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} - 22.True or false: padding is the gap round content. (a) False (b) True
-
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 25px;
border: 2px solid black;
margin: 10px;
} - 24.True or false: padding is space outside the border. (a) True (b) False
-
25.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 25px;
border: 5px solid black;
margin: 10px;
} - 26.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) the text or picture (d) the gap round content
-
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: 260px;
padding: 5px;
border: 3px solid black;
margin: 10px;
} - 28.True or false: padding is space inside the border. (a) True (b) False
-
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 4px solid black;
margin: 10px;
} - 30.True or false: the content is the text or picture. (a) True (b) False
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 50px;
padding: 30px;
border: 4px solid black;
margin: 0px;
} - 33.True or false: the content is the line round the box. (a) True (b) False
-
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
36.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 30px;
border: 5px solid black;
margin: 20px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 30px;
border: 3px solid black;
margin: 10px;
} - 40.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) content (d) margin
Answer key
- the gap to other boxes
- margin
- 250
- space inside the border
- border
- 124
- 224
- the line round the box
- False
- 264
- True
- 262
- 258
- False
- 142
- a solid or dotted edge
- margin
- False
- 60
- 240
- 108
- True
- 234
- False
- 170
- the gap round content
- 276
- True
- 198
- True
- 128
- 118
- False
- 118
- 326
- 198
- 230
- 304
- 326
- border
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids