← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 176
  2. 276
  3. 178
  4. 136
  5. 272
  6. 154
  7. the gap round content
  8. padding
  9. padding
  10. the gap to other boxes
  11. space outside the border
  12. margin
  13. 194
  14. space inside the border
  15. the text or picture
  16. 320
  17. content
  18. True
  19. 142
  20. False
  21. True
  22. 108
  23. 216
  24. 292
  25. False
  26. 182
  27. False
  28. False
  29. 94
  30. 136
  31. 238
  32. False
  33. border
  34. the line round the box
  35. 190
  36. 328
  37. 262
  38. 194
  39. 248
  40. a solid or dotted edge

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