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 the gap to other boxes. (a) True (b) False
- 2.Which of these is margin? (a) a solid or dotted edge (b) the line round the box (c) the gap to other boxes (d) the text or picture
-
3.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 70px;
padding: 10px;
border: 5px solid black;
margin: 0px;
} - 4.📦 In the box model, which part is the text or picture? (a) border (b) margin (c) padding (d) content
- 5.📦 In the box model, which part is space inside the border? (a) border (b) padding (c) content (d) margin
- 6.Which of these is padding? (a) a solid or dotted edge (b) the gap round content (c) the text or picture (d) the line round the box
-
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 290px;
padding: 5px;
border: 2px solid black;
margin: 15px;
} -
8.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 180px;
padding: 20px;
border: 2px solid black;
margin: 5px;
} -
9.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 160px;
padding: 10px;
border: 4px solid black;
margin: 0px;
} -
10.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 100px;
padding: 5px;
border: 5px solid black;
margin: 10px;
} -
11.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 3px solid black;
margin: 10px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 25px;
border: 1px solid black;
margin: 0px;
} -
13.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 10px;
border: 3px solid black;
margin: 20px;
} - 14.True or false: the content is the gap round content. (a) True (b) False
- 15.Which of these is the content? (a) the text or picture (b) space outside the border (c) the gap round content (d) a solid or dotted edge
-
16.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 5px;
border: 4px solid black;
margin: 15px;
} -
17.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 25px;
border: 4px solid black;
margin: 0px;
} -
18.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 80px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} - 19.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) content (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: 280px;
padding: 30px;
border: 2px solid black;
margin: 15px;
} - 21.📦 In the box model, which part is the gap round content? (a) content (b) margin (c) padding (d) border
-
22.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 120px;
padding: 25px;
border: 4px solid black;
margin: 15px;
} -
23.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 150px;
padding: 5px;
border: 1px solid black;
margin: 20px;
} - 24.Which of these is margin? (a) the line round the box (b) the gap round content (c) space inside the border (d) space outside the border
-
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: 100px;
padding: 5px;
border: 3px solid black;
margin: 15px;
} -
26.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 30px;
border: 2px solid black;
margin: 10px;
} -
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 180px;
padding: 20px;
border: 5px solid black;
margin: 10px;
} - 28.True or false: the content is a solid or dotted edge. (a) True (b) False
-
29.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 20px;
border: 2px solid black;
margin: 10px;
} - 30.True or false: margin is space inside the border. (a) True (b) False
-
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 140px;
padding: 25px;
border: 4px solid black;
margin: 10px;
} -
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: 70px;
padding: 20px;
border: 1px solid black;
margin: 0px;
} -
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: 300px;
padding: 5px;
border: 1px solid black;
margin: 10px;
} -
34.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 100px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} -
35.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} - 36.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
-
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: 90px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 38.Which of these is the border? (a) the text or picture (b) the gap to other boxes (c) a solid or dotted edge (d) space outside the border
- 39.True or false: the border is space inside the border. (a) False (b) True
- 40.True or false: the content is the text or picture. (a) False (b) True
Answer key
- False
- the gap to other boxes
- 100
- content
- padding
- the gap round content
- 334
- 234
- 188
- 140
- 316
- 292
- 146
- False
- the text or picture
- 168
- 358
- 122
- margin
- 344
- padding
- 208
- 202
- space outside the border
- 116
- 174
- 250
- False
- 154
- False
- 218
- 112
- 312
- 164
- 288
- space inside the border
- 126
- a solid or dotted edge
- False
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids