← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 120
  2. False
  3. 216
  4. False
  5. 134
  6. 142
  7. 178
  8. 120
  9. 260
  10. padding
  11. a solid or dotted edge
  12. 258
  13. 142
  14. 222
  15. the line round the box
  16. False
  17. padding
  18. 282
  19. 146
  20. 244
  21. the gap to other boxes
  22. True
  23. the text or picture
  24. 174
  25. space outside the border
  26. border
  27. margin
  28. 180
  29. 180
  30. 88
  31. the gap round content
  32. 98
  33. 200
  34. 270
  35. margin
  36. 198
  37. 256
  38. 252
  39. 174
  40. False

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