← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 166
  2. the gap round content
  3. False
  4. a solid or dotted edge
  5. 156
  6. 242
  7. margin
  8. border
  9. 330
  10. False
  11. 214
  12. 292
  13. False
  14. False
  15. 150
  16. False
  17. space inside the border
  18. True
  19. 168
  20. 266
  21. 238
  22. 112
  23. 208
  24. 224
  25. True
  26. padding
  27. the gap to other boxes
  28. 140
  29. 318
  30. 86
  31. 350
  32. 272
  33. True
  34. the text or picture
  35. 92
  36. True
  37. True
  38. 112
  39. True
  40. margin

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