← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 256
  3. 190
  4. 248
  5. 360
  6. 208
  7. border
  8. 170
  9. margin
  10. 180
  11. 152
  12. 348
  13. True
  14. 214
  15. margin
  16. 244
  17. 238
  18. 160
  19. 250
  20. 294
  21. 168
  22. False
  23. 142
  24. padding
  25. 162
  26. True
  27. 154
  28. 314
  29. 292
  30. space outside the border
  31. 328
  32. True
  33. padding
  34. False
  35. content
  36. 286
  37. the gap round content
  38. 298
  39. 174
  40. 98

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