← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 112
  2. 144
  3. 126
  4. 116
  5. 202
  6. False
  7. border
  8. 178
  9. 298
  10. padding
  11. True
  12. 114
  13. True
  14. 202
  15. the gap round content
  16. 162
  17. 194
  18. 218
  19. 274
  20. False
  21. 104
  22. 124
  23. border
  24. space inside the border
  25. 134
  26. content
  27. the gap to other boxes
  28. 252
  29. 194
  30. 120
  31. 360
  32. 280
  33. margin
  34. True
  35. 120
  36. the text or picture
  37. 324
  38. space outside the border
  39. 170
  40. a solid or dotted edge

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