← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 206
  2. 126
  3. 226
  4. padding
  5. False
  6. 94
  7. margin
  8. 302
  9. 282
  10. True
  11. 146
  12. the gap to other boxes
  13. False
  14. 84
  15. 200
  16. True
  17. the gap round content
  18. 234
  19. 88
  20. 146
  21. 124
  22. 304
  23. True
  24. 206
  25. 230
  26. 166
  27. a solid or dotted edge
  28. the text or picture
  29. False
  30. content
  31. 114
  32. space outside the border
  33. 170
  34. border
  35. 212
  36. False
  37. 258
  38. 356
  39. margin
  40. 246

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