← The box model lesson New set →

CSS Worksheet: Box Model

HTML and CSS lesson 16: The box model · Set 217 · 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.True or false: the content is the text or picture. (a) True (b) False
  2. 2.True or false: margin is the gap to other boxes. (a) False (b) True
  3. 3.📦 In the box model, which part is the gap round content? (a) border (b) padding (c) margin (d) content
  4. 4.True or false: padding is the gap round content. (a) True (b) False
  5. 5.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 300px;
      padding: 25px;
      border: 3px solid black;
      margin: 15px;
    }
  6. 6.Which of these is padding? (a) the gap to other boxes (b) the text or picture (c) space inside the border (d) space outside the border
  7. 7.True or false: margin is space outside the border. (a) False (b) True
  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 inside the border
  9. 9.True or false: margin is a solid or dotted edge. (a) True (b) False
  10. 10.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 130px;
      padding: 10px;
      border: 4px solid black;
      margin: 10px;
    }
  11. 11.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 100px;
      padding: 15px;
      border: 3px solid black;
      margin: 0px;
    }
  12. 12.📦 In the box model, which part is space inside the border? (a) content (b) margin (c) border (d) padding
  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: 130px;
      padding: 5px;
      border: 1px solid black;
      margin: 20px;
    }
  14. 14.📦 In the box model, which part is space outside the border? (a) border (b) margin (c) content (d) padding
  15. 15.True or false: padding is the line round the box. (a) False (b) True
  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: 250px;
      padding: 15px;
      border: 1px solid black;
      margin: 5px;
    }
  17. 17.📦 In the box model, which part is the line round the box? (a) padding (b) border (c) content (d) margin
  18. 18.📦 In the box model, which part is a solid or dotted edge? (a) border (b) content (c) margin (d) padding
  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: 120px;
      padding: 5px;
      border: 2px 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: 130px;
      padding: 25px;
      border: 3px solid black;
      margin: 10px;
    }
  21. 21.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 290px;
      padding: 20px;
      border: 4px solid black;
      margin: 15px;
    }
  22. 22.📦 In the box model, which part is the gap to other boxes? (a) padding (b) margin (c) content (d) border
  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: 260px;
      padding: 25px;
      border: 2px solid black;
      margin: 0px;
    }
  24. 24.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 130px;
      padding: 15px;
      border: 1px solid black;
      margin: 20px;
    }
  25. 25.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
  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: 210px;
      padding: 20px;
      border: 4px solid black;
      margin: 0px;
    }
  27. 27.Which of these is padding? (a) the gap to other boxes (b) the gap round content (c) the line round the box (d) space outside the border
  28. 28.📦 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: 20px;
      border: 2px solid black;
      margin: 0px;
    }
  29. 29.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 170px;
      padding: 5px;
      border: 5px solid black;
      margin: 5px;
    }
  30. 30.True or false: padding is space inside the border. (a) False (b) True
  31. 31.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 230px;
      padding: 15px;
      border: 5px solid black;
      margin: 15px;
    }
  32. 32.True or false: the content is space outside the border. (a) False (b) True
  33. 33.📦 In the box model, which part is the text or picture? (a) padding (b) border (c) margin (d) content
  34. 34.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 50px;
      padding: 10px;
      border: 4px solid black;
      margin: 0px;
    }
  35. 35.Which of these is the border? (a) the text or picture (b) space outside the border (c) the line round the box (d) space inside the border
  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: 15px;
      border: 3px solid black;
      margin: 15px;
    }
  37. 37.Which of these is the border? (a) space outside the border (b) space inside the border (c) a solid or dotted edge (d) the gap round content
  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: 120px;
      padding: 30px;
      border: 1px solid black;
      margin: 15px;
    }
  39. 39.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 100px;
      padding: 15px;
      border: 5px solid black;
      margin: 5px;
    }
  40. 40.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 170px;
      padding: 20px;
      border: 4px solid black;
      margin: 5px;
    }

Answer key

  1. True
  2. True
  3. padding
  4. True
  5. 386
  6. space inside the border
  7. True
  8. the text or picture
  9. False
  10. 178
  11. 136
  12. padding
  13. 142
  14. margin
  15. False
  16. 282
  17. border
  18. border
  19. 134
  20. 186
  21. 368
  22. margin
  23. 314
  24. 202
  25. the gap to other boxes
  26. 258
  27. the gap round content
  28. 164
  29. 200
  30. True
  31. 300
  32. False
  33. content
  34. 78
  35. the line round the box
  36. 236
  37. a solid or dotted edge
  38. 182
  39. 150
  40. 228

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