← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. 336
  3. True
  4. True
  5. margin
  6. 232
  7. 148
  8. the text or picture
  9. margin
  10. False
  11. 156
  12. 132
  13. the gap round content
  14. 130
  15. 202
  16. 100
  17. padding
  18. 272
  19. the gap to other boxes
  20. 206
  21. True
  22. 132
  23. 272
  24. 94
  25. space inside the border
  26. 94
  27. False
  28. 100
  29. 220
  30. 196
  31. padding
  32. content
  33. 110
  34. 138
  35. 238
  36. 222
  37. 338
  38. 198
  39. 298
  40. False

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