← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 372
  2. True
  3. 92
  4. the gap round content
  5. 152
  6. the gap to other boxes
  7. content
  8. 140
  9. False
  10. 206
  11. the text or picture
  12. padding
  13. margin
  14. False
  15. True
  16. the line round the box
  17. border
  18. True
  19. False
  20. 192
  21. space outside the border
  22. a solid or dotted edge
  23. 202
  24. space inside the border
  25. border
  26. 188
  27. 262
  28. 226
  29. 240
  30. 194
  31. 112
  32. 112
  33. 284
  34. 176
  35. True
  36. True
  37. padding
  38. margin
  39. 122
  40. 286

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