← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 250
  2. 358
  3. 252
  4. 178
  5. 208
  6. the gap to other boxes
  7. padding
  8. False
  9. the text or picture
  10. 312
  11. True
  12. 134
  13. 220
  14. 176
  15. content
  16. border
  17. 334
  18. False
  19. space outside the border
  20. 98
  21. False
  22. True
  23. padding
  24. 358
  25. 246
  26. 214
  27. 356
  28. False
  29. 306
  30. 160
  31. 248
  32. 210
  33. 220
  34. 108
  35. 198
  36. 120
  37. space inside the border
  38. the line round the box
  39. margin
  40. 188

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