← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. 292
  3. 178
  4. border
  5. 330
  6. True
  7. False
  8. border
  9. 262
  10. 186
  11. padding
  12. margin
  13. 316
  14. 142
  15. 124
  16. 186
  17. 266
  18. padding
  19. 228
  20. 80
  21. 294
  22. the line round the box
  23. a solid or dotted edge
  24. True
  25. 190
  26. 378
  27. 214
  28. False
  29. 140
  30. margin
  31. 210
  32. 106
  33. 314
  34. 164
  35. 110
  36. the text or picture
  37. False
  38. 154
  39. False
  40. False

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