← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. 242
  3. margin
  4. True
  5. False
  6. the text or picture
  7. 182
  8. 344
  9. 106
  10. 182
  11. 316
  12. padding
  13. False
  14. 262
  15. 144
  16. True
  17. space outside the border
  18. 292
  19. 350
  20. False
  21. 228
  22. True
  23. 88
  24. 156
  25. 244
  26. 356
  27. True
  28. True
  29. 234
  30. False
  31. the line round the box
  32. 300
  33. False
  34. 294
  35. the gap to other boxes
  36. 182
  37. margin
  38. padding
  39. 152
  40. 210

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