← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. content
  3. False
  4. True
  5. 192
  6. 376
  7. 154
  8. the line round the box
  9. True
  10. the gap to other boxes
  11. space inside the border
  12. 114
  13. True
  14. the gap round content
  15. 138
  16. margin
  17. True
  18. 262
  19. True
  20. 178
  21. True
  22. padding
  23. 110
  24. the text or picture
  25. 224
  26. 134
  27. 266
  28. 260
  29. False
  30. 266
  31. 266
  32. 172
  33. 244
  34. 274
  35. 192
  36. 232
  37. 192
  38. margin
  39. 72
  40. 182

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