← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. 228
  3. border
  4. 262
  5. margin
  6. 300
  7. 298
  8. 210
  9. 182
  10. 150
  11. 272
  12. 168
  13. 248
  14. content
  15. margin
  16. 214
  17. 244
  18. 170
  19. space outside the border
  20. 86
  21. 94
  22. 326
  23. 134
  24. the line round the box
  25. True
  26. 74
  27. False
  28. 130
  29. False
  30. the text or picture
  31. 198
  32. 120
  33. padding
  34. False
  35. True
  36. the gap to other boxes
  37. True
  38. 172
  39. 192
  40. a solid or dotted edge

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