← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. content
  3. 230
  4. margin
  5. 264
  6. False
  7. 200
  8. 64
  9. False
  10. 164
  11. False
  12. space inside the border
  13. the gap round content
  14. a solid or dotted edge
  15. True
  16. 236
  17. 194
  18. 136
  19. padding
  20. border
  21. the line round the box
  22. 308
  23. 156
  24. 146
  25. 246
  26. False
  27. 204
  28. 198
  29. 238
  30. 200
  31. False
  32. 316
  33. 160
  34. the text or picture
  35. 322
  36. False
  37. True
  38. border
  39. 204
  40. space outside the border

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