← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. 340
  3. 300
  4. 166
  5. 128
  6. 256
  7. the text or picture
  8. 202
  9. False
  10. 122
  11. padding
  12. the gap round content
  13. 120
  14. False
  15. 142
  16. True
  17. a solid or dotted edge
  18. the gap to other boxes
  19. content
  20. 142
  21. 158
  22. border
  23. 136
  24. 330
  25. 140
  26. 116
  27. False
  28. False
  29. 172
  30. False
  31. 352
  32. 298
  33. 306
  34. 322
  35. 308
  36. space outside the border
  37. 340
  38. 94
  39. False
  40. False

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