← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 178
  2. 318
  3. 176
  4. 304
  5. 300
  6. False
  7. margin
  8. the line round the box
  9. 140
  10. space outside the border
  11. 184
  12. True
  13. True
  14. the gap to other boxes
  15. False
  16. 158
  17. border
  18. 242
  19. 364
  20. 166
  21. a solid or dotted edge
  22. padding
  23. 354
  24. 138
  25. 194
  26. 98
  27. padding
  28. True
  29. True
  30. 110
  31. 252
  32. 212
  33. content
  34. margin
  35. space inside the border
  36. False
  37. 104
  38. 292
  39. the gap round content
  40. 174

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