← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 302
  2. False
  3. False
  4. 280
  5. 98
  6. margin
  7. 202
  8. the line round the box
  9. the gap round content
  10. 130
  11. the gap to other boxes
  12. border
  13. 180
  14. padding
  15. True
  16. space outside the border
  17. 86
  18. 126
  19. 192
  20. 230
  21. 152
  22. margin
  23. 90
  24. True
  25. 266
  26. 134
  27. 364
  28. the text or picture
  29. 206
  30. padding
  31. False
  32. True
  33. 328
  34. content
  35. 268
  36. 216
  37. space inside the border
  38. False
  39. 138
  40. 204

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