← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 216
  2. 352
  3. 314
  4. 212
  5. 86
  6. False
  7. True
  8. 252
  9. 180
  10. 244
  11. 300
  12. 142
  13. 142
  14. 338
  15. 96
  16. 156
  17. 146
  18. 292
  19. content
  20. 316
  21. True
  22. border
  23. margin
  24. a solid or dotted edge
  25. 204
  26. padding
  27. False
  28. space outside the border
  29. False
  30. 228
  31. the text or picture
  32. False
  33. margin
  34. False
  35. 164
  36. 198
  37. False
  38. False
  39. 246
  40. 292

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