← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 110
  2. 94
  3. padding
  4. 358
  5. the gap to other boxes
  6. a solid or dotted edge
  7. 106
  8. 158
  9. space inside the border
  10. padding
  11. 122
  12. False
  13. False
  14. margin
  15. the line round the box
  16. 130
  17. 318
  18. the text or picture
  19. False
  20. True
  21. 162
  22. 134
  23. 348
  24. 262
  25. 224
  26. 198
  27. 242
  28. border
  29. True
  30. False
  31. 140
  32. True
  33. margin
  34. 190
  35. False
  36. 178
  37. 346
  38. 340
  39. 242
  40. 220

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