← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. False
  3. False
  4. True
  5. content
  6. 136
  7. border
  8. 242
  9. True
  10. 198
  11. margin
  12. False
  13. 76
  14. 272
  15. 100
  16. the gap round content
  17. 74
  18. False
  19. 260
  20. the text or picture
  21. the line round the box
  22. a solid or dotted edge
  23. space inside the border
  24. 210
  25. 196
  26. True
  27. 154
  28. padding
  29. border
  30. 322
  31. 164
  32. space outside the border
  33. True
  34. 322
  35. 188
  36. 176
  37. 324
  38. 154
  39. 232
  40. padding

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