← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 176
  2. False
  3. False
  4. 136
  5. padding
  6. 264
  7. 212
  8. margin
  9. 102
  10. 344
  11. 120
  12. True
  13. 240
  14. space inside the border
  15. content
  16. 286
  17. border
  18. 154
  19. 174
  20. 152
  21. a solid or dotted edge
  22. the gap to other boxes
  23. 282
  24. True
  25. False
  26. 148
  27. False
  28. space outside the border
  29. 152
  30. 314
  31. 198
  32. 154
  33. 196
  34. padding
  35. 328
  36. 142
  37. border
  38. 158
  39. 148
  40. 216

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