← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 160
  2. 322
  3. 322
  4. 178
  5. 166
  6. 296
  7. 186
  8. border
  9. space inside the border
  10. 210
  11. False
  12. the text or picture
  13. the gap round content
  14. 74
  15. 306
  16. 112
  17. space outside the border
  18. padding
  19. margin
  20. margin
  21. 184
  22. 354
  23. 140
  24. border
  25. 90
  26. padding
  27. False
  28. 202
  29. a solid or dotted edge
  30. 126
  31. 336
  32. 260
  33. 198
  34. 166
  35. 96
  36. 166
  37. 122
  38. 200
  39. 146
  40. 336

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