← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 314
  2. 204
  3. 268
  4. 332
  5. 320
  6. 330
  7. padding
  8. 154
  9. padding
  10. the gap to other boxes
  11. False
  12. 280
  13. True
  14. 86
  15. margin
  16. 134
  17. 248
  18. a solid or dotted edge
  19. space inside the border
  20. border
  21. 180
  22. False
  23. space outside the border
  24. border
  25. the gap round content
  26. content
  27. True
  28. 298
  29. 230
  30. 296
  31. 102
  32. False
  33. 230
  34. 72
  35. 324
  36. False
  37. False
  38. the line round the box
  39. 184
  40. True

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