← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 152
  3. a solid or dotted edge
  4. True
  5. the text or picture
  6. 230
  7. 222
  8. 234
  9. space inside the border
  10. border
  11. the gap to other boxes
  12. 284
  13. space outside the border
  14. 194
  15. 194
  16. 128
  17. 156
  18. 104
  19. 88
  20. 334
  21. 246
  22. the line round the box
  23. border
  24. True
  25. padding
  26. the gap round content
  27. 142
  28. 190
  29. 258
  30. True
  31. margin
  32. True
  33. True
  34. 280
  35. 166
  36. 170
  37. margin
  38. False
  39. 192
  40. 336

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