← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. content
  3. 242
  4. 148
  5. space outside the border
  6. border
  7. 122
  8. True
  9. 124
  10. 272
  11. padding
  12. 178
  13. False
  14. 240
  15. 184
  16. 242
  17. 210
  18. False
  19. margin
  20. 212
  21. margin
  22. 92
  23. 96
  24. 250
  25. 204
  26. False
  27. 368
  28. False
  29. False
  30. 160
  31. 114
  32. 314
  33. 160
  34. 200
  35. 182
  36. 126
  37. 198
  38. True
  39. 84
  40. a solid or dotted edge

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