← The box model lesson New set →

CSS Worksheet: Box Model

HTML and CSS lesson 16: The box model · Set 893 · 40 questions
TalentJR

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. 1.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 50px;
      padding: 30px;
      border: 5px solid black;
      margin: 20px;
    }
  2. 2.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 150px;
      padding: 5px;
      border: 3px solid black;
      margin: 15px;
    }
  3. 3.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 220px;
      padding: 15px;
      border: 2px solid black;
      margin: 20px;
    }
  4. 4.📦 In the box model, which part is the line round the box? (a) padding (b) margin (c) border (d) content
  5. 5.📦 In the box model, which part is the gap to other boxes? (a) content (b) padding (c) border (d) margin
  6. 6.True or false: margin is the text or picture. (a) True (b) False
  7. 7.Which of these is padding? (a) the gap to other boxes (b) the text or picture (c) the gap round content (d) a solid or dotted edge
  8. 8.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) border (c) padding (d) content
  9. 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: 70px;
      padding: 30px;
      border: 1px solid black;
      margin: 5px;
    }
  10. 10.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 200px;
      padding: 10px;
      border: 3px solid black;
      margin: 20px;
    }
  11. 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: 210px;
      padding: 15px;
      border: 3px solid black;
      margin: 5px;
    }
  12. 12.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 80px;
      padding: 5px;
      border: 1px solid black;
      margin: 15px;
    }
  13. 13.True or false: padding is space inside the border. (a) True (b) False
  14. 14.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 260px;
      padding: 15px;
      border: 2px solid black;
      margin: 15px;
    }
  15. 15.📦 In the box model, which part is space inside the border? (a) content (b) border (c) padding (d) margin
  16. 16.Which of these is margin? (a) space outside the border (b) space inside the border (c) a solid or dotted edge (d) the gap round content
  17. 17.📦 In the box model, which part is space outside the border? (a) padding (b) margin (c) border (d) content
  18. 18.📦 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;
    }
  19. 19.Which of these is padding? (a) a solid or dotted edge (b) the line round the box (c) space inside the border (d) the gap to other boxes
  20. 20.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 220px;
      padding: 10px;
      border: 3px solid black;
      margin: 15px;
    }
  21. 21.True or false: the border is a solid or dotted edge. (a) True (b) False
  22. 22.📦 In the box model, which part is the gap round content? (a) margin (b) content (c) border (d) padding
  23. 23.Which of these is the border? (a) space outside the border (b) a solid or dotted edge (c) the gap round content (d) space inside the border
  24. 24.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 70px;
      padding: 5px;
      border: 5px solid black;
      margin: 5px;
    }
  25. 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: 90px;
      padding: 30px;
      border: 4px solid black;
      margin: 20px;
    }
  26. 26.True or false: the content is the line round the box. (a) False (b) True
  27. 27.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 220px;
      padding: 10px;
      border: 5px solid black;
      margin: 5px;
    }
  28. 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: 170px;
      padding: 15px;
      border: 1px solid black;
      margin: 10px;
    }
  29. 29.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 120px;
      padding: 20px;
      border: 4px solid black;
      margin: 0px;
    }
  30. 30.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 210px;
      padding: 20px;
      border: 3px solid black;
      margin: 0px;
    }
  31. 31.True or false: the content is a solid or dotted edge. (a) True (b) False
  32. 32.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 140px;
      padding: 5px;
      border: 1px solid black;
      margin: 10px;
    }
  33. 33.Which of these is margin? (a) the text or picture (b) space inside the border (c) the line round the box (d) the gap to other boxes
  34. 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: 140px;
      padding: 25px;
      border: 4px solid black;
      margin: 10px;
    }
  35. 35.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 170px;
      padding: 25px;
      border: 3px solid black;
      margin: 5px;
    }
  36. 36.📦 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: 25px;
      border: 4px solid black;
      margin: 0px;
    }
  37. 37.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 120px;
      padding: 10px;
      border: 3px solid black;
      margin: 15px;
    }
  38. 38.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 180px;
      padding: 15px;
      border: 4px solid black;
      margin: 10px;
    }
  39. 39.True or false: margin is space inside the border. (a) True (b) False
  40. 40.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 230px;
      padding: 20px;
      border: 3px solid black;
      margin: 15px;
    }

Answer key

  1. 160
  2. 196
  3. 294
  4. border
  5. margin
  6. False
  7. the gap round content
  8. border
  9. 132
  10. 266
  11. 246
  12. 122
  13. True
  14. 324
  15. padding
  16. space outside the border
  17. margin
  18. 138
  19. space inside the border
  20. 276
  21. True
  22. padding
  23. a solid or dotted edge
  24. 100
  25. 158
  26. False
  27. 260
  28. 202
  29. 168
  30. 256
  31. False
  32. 172
  33. the gap to other boxes
  34. 198
  35. 236
  36. 358
  37. 176
  38. 238
  39. False
  40. 306

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids