← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space outside the border
  2. False
  3. space inside the border
  4. True
  5. 140
  6. 296
  7. True
  8. 340
  9. 200
  10. 216
  11. 176
  12. True
  13. True
  14. 152
  15. 84
  16. 228
  17. 278
  18. 182
  19. border
  20. margin
  21. True
  22. True
  23. a solid or dotted edge
  24. 356
  25. padding
  26. the gap round content
  27. 104
  28. 314
  29. 260
  30. 108
  31. 94
  32. 90
  33. 216
  34. 260
  35. 254
  36. False
  37. 188
  38. 144
  39. content
  40. False

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