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) the text or picture (b) a solid or dotted edge (c) the gap to other boxes (d) the line round the box
- 2.True or false: margin is the gap to other boxes. (a) False (b) True
-
3.📦 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: 10px;
border: 5px solid black;
margin: 10px;
} - 4.True or false: padding is the text or picture. (a) True (b) False
-
5.📦 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: 20px;
} -
6.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 60px;
padding: 10px;
border: 4px solid black;
margin: 10px;
} - 7.📦 In the box model, which part is the gap to other boxes? (a) border (b) margin (c) padding (d) content
-
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: 5px;
border: 1px solid black;
margin: 0px;
} - 9.📦 In the box model, which part is the text or picture? (a) margin (b) padding (c) content (d) border
- 10.Which of these is the border? (a) the line round the box (b) the gap to other boxes (c) space inside the border (d) the gap round content
-
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: 250px;
padding: 10px;
border: 2px solid black;
margin: 5px;
} -
12.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 300px;
padding: 30px;
border: 3px solid black;
margin: 5px;
} -
13.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 260px;
padding: 25px;
border: 4px solid black;
margin: 5px;
} - 14.Which of these is the content? (a) the text or picture (b) space outside the border (c) space inside the border (d) the gap to other boxes
- 15.True or false: margin is the gap round content. (a) True (b) False
- 16.True or false: the content is the gap round content. (a) True (b) False
-
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: 170px;
padding: 25px;
border: 2px solid black;
margin: 5px;
} - 18.Which of these is margin? (a) the text or picture (b) space outside the border (c) the gap round content (d) space inside the border
-
19.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 270px;
padding: 15px;
border: 1px solid black;
margin: 5px;
} -
20.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 90px;
padding: 5px;
border: 3px solid black;
margin: 20px;
} - 21.True or false: margin is a solid or dotted edge. (a) False (b) True
-
22.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 120px;
padding: 25px;
border: 3px solid black;
margin: 5px;
} - 23.📦 In the box model, which part is the line round the box? (a) content (b) border (c) margin (d) padding
-
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: 200px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} -
25.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 170px;
padding: 15px;
border: 3px solid black;
margin: 5px;
} - 26.📦 In the box model, which part is space inside the border? (a) content (b) padding (c) margin (d) border
-
27.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 240px;
padding: 20px;
border: 3px solid black;
margin: 5px;
} - 28.Which of these is the border? (a) space inside the border (b) a solid or dotted edge (c) the gap round content (d) the gap to other boxes
-
29.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 70px;
padding: 25px;
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: 240px;
padding: 20px;
border: 3px solid black;
margin: 20px;
} -
31.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 150px;
padding: 10px;
border: 2px solid black;
margin: 0px;
} -
32.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 90px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} - 33.True or false: margin is the line round the box. (a) True (b) False
-
34.📦 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: 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: 110px;
padding: 10px;
border: 4px solid black;
margin: 5px;
} -
36.📦 How much space top to bottom (px) does this box take in all, margin included?
.box {
height: 130px;
padding: 15px;
border: 3px solid black;
margin: 10px;
} -
37.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 170px;
padding: 5px;
border: 4px solid black;
margin: 0px;
} -
38.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 210px;
padding: 30px;
border: 1px solid black;
margin: 0px;
} - 39.True or false: padding is space inside the border. (a) True (b) False
- 40.True or false: the border is the line round the box. (a) True (b) False
Answer key
- the gap to other boxes
- True
- 160
- False
- 108
- 108
- margin
- 172
- content
- the line round the box
- 274
- 376
- 328
- the text or picture
- False
- False
- 224
- space outside the border
- 312
- 146
- False
- 186
- border
- 246
- 216
- padding
- 296
- a solid or dotted edge
- 128
- 286
- 174
- 108
- False
- 276
- 138
- 186
- 188
- 272
- True
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids