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: padding is space outside the border. (a) True (b) False
- 2.Which of these is the border? (a) the text or picture (b) the gap to other boxes (c) a solid or dotted edge (d) the gap round content
- 3.True or false: the border is a solid or dotted edge. (a) False (b) True
- 4.Which of these is the border? (a) space inside the border (b) the text or picture (c) the line round the box (d) the gap round content
-
5.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
border: 3px solid black;
margin: 15px;
} - 6.True or false: margin is the gap to other boxes. (a) False (b) True
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 20px;
border: 1px solid black;
margin: 20px;
} -
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
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: 250px;
padding: 5px;
border: 5px solid black;
margin: 20px;
} - 10.True or false: the border is the line round the box. (a) False (b) True
-
11.📦 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: 0px;
} - 12.True or false: padding is the gap round content. (a) True (b) False
- 13.True or false: the content is the text or picture. (a) False (b) True
-
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: 180px;
padding: 10px;
border: 5px solid black;
margin: 15px;
} -
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: 100px;
padding: 10px;
border: 2px solid black;
margin: 15px;
} - 16.True or false: padding is a solid or dotted edge. (a) False (b) True
- 17.📦 In the box model, which part is the text or picture? (a) border (b) padding (c) content (d) margin
-
18.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 220px;
padding: 5px;
border: 4px solid black;
margin: 5px;
} - 19.📦 In the box model, which part is space outside the border? (a) border (b) padding (c) margin (d) content
- 20.Which of these is margin? (a) the text or picture (b) a solid or dotted edge (c) space outside the border (d) the line round the box
-
21.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 25px;
border: 2px solid black;
margin: 15px;
} -
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: 150px;
padding: 15px;
border: 2px solid black;
margin: 15px;
} -
23.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 4px 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: 130px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} - 25.True or false: the border is space inside the border. (a) False (b) True
- 26.True or false: margin is the gap round content. (a) True (b) False
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 25px;
border: 5px solid black;
margin: 20px;
} - 28.True or false: the content is the gap round content. (a) True (b) False
-
29.📦 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: 0px;
} -
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: 140px;
padding: 5px;
border: 2px solid black;
margin: 10px;
} - 31.True or false: the content is space inside the border. (a) True (b) False
-
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 10px;
border: 4px solid black;
margin: 20px;
} -
33.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 190px;
padding: 10px;
border: 3px solid black;
margin: 15px;
} -
34.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 140px;
padding: 25px;
border: 3px solid black;
margin: 0px;
} -
35.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 120px;
padding: 10px;
border: 1px solid black;
margin: 10px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 40px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} -
37.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 15px;
border: 1px solid black;
margin: 15px;
} -
38.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 250px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} -
39.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
40.📦 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: 5px solid black;
margin: 10px;
}
Answer key
- False
- a solid or dotted edge
- True
- the line round the box
- 156
- True
- 332
- 208
- 270
- True
- 214
- True
- True
- 210
- 124
- False
- content
- 248
- margin
- space outside the border
- 264
- 184
- 138
- 144
- False
- False
- 220
- False
- 168
- 154
- False
- 168
- 246
- 196
- 142
- 104
- 152
- 286
- 144
- 170
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids