← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 198
  2. 322
  3. content
  4. padding
  5. False
  6. padding
  7. True
  8. 270
  9. 204
  10. the line round the box
  11. False
  12. 312
  13. space outside the border
  14. the text or picture
  15. the gap round content
  16. 124
  17. 162
  18. the gap to other boxes
  19. False
  20. margin
  21. 84
  22. False
  23. True
  24. margin
  25. border
  26. 274
  27. False
  28. 292
  29. True
  30. 228
  31. 324
  32. 322
  33. 166
  34. 228
  35. False
  36. 338
  37. False
  38. space inside the border
  39. 298
  40. 248

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