← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 230
  3. 158
  4. space inside the border
  5. False
  6. 148
  7. 158
  8. the text or picture
  9. 206
  10. 224
  11. False
  12. border
  13. True
  14. the gap round content
  15. 178
  16. border
  17. padding
  18. 196
  19. 306
  20. 292
  21. 130
  22. 194
  23. margin
  24. 156
  25. 108
  26. 122
  27. 170
  28. space outside the border
  29. 284
  30. 192
  31. 116
  32. 112
  33. 92
  34. 198
  35. 198
  36. False
  37. True
  38. False
  39. 264
  40. 274

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