← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 214
  2. True
  3. 130
  4. padding
  5. 160
  6. 120
  7. False
  8. 134
  9. border
  10. space outside the border
  11. False
  12. False
  13. 372
  14. the text or picture
  15. border
  16. 366
  17. 254
  18. False
  19. 132
  20. 334
  21. 96
  22. True
  23. margin
  24. 136
  25. 194
  26. 92
  27. 270
  28. 238
  29. 208
  30. 108
  31. margin
  32. padding
  33. True
  34. 158
  35. 244
  36. 254
  37. 188
  38. True
  39. 194
  40. 182

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