← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. margin
  3. 230
  4. False
  5. 248
  6. the text or picture
  7. the gap to other boxes
  8. 242
  9. 208
  10. 214
  11. 108
  12. 350
  13. True
  14. padding
  15. False
  16. 172
  17. True
  18. margin
  19. 108
  20. padding
  21. 276
  22. 346
  23. content
  24. 376
  25. False
  26. 84
  27. 130
  28. 130
  29. 340
  30. border
  31. 262
  32. the line round the box
  33. True
  34. False
  35. 200
  36. 158
  37. 134
  38. 162
  39. 214
  40. 226

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