← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 386
  2. 156
  3. 124
  4. 326
  5. padding
  6. 174
  7. 348
  8. 228
  9. the gap to other boxes
  10. space inside the border
  11. 300
  12. 338
  13. 188
  14. 184
  15. True
  16. 208
  17. 238
  18. margin
  19. 262
  20. 96
  21. the text or picture
  22. border
  23. 188
  24. False
  25. 246
  26. 108
  27. 272
  28. 336
  29. margin
  30. 274
  31. 322
  32. space outside the border
  33. False
  34. 184
  35. 190
  36. border
  37. 260
  38. True
  39. 310
  40. 244

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