← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. margin
  3. 124
  4. 194
  5. True
  6. the gap round content
  7. 266
  8. content
  9. False
  10. 106
  11. 172
  12. space outside the border
  13. the text or picture
  14. 192
  15. 176
  16. 132
  17. 218
  18. 210
  19. 132
  20. 172
  21. 232
  22. 228
  23. 76
  24. a solid or dotted edge
  25. padding
  26. 124
  27. 168
  28. 136
  29. padding
  30. margin
  31. space inside the border
  32. False
  33. 272
  34. border
  35. 108
  36. True
  37. True
  38. the line round the box
  39. 196
  40. 186

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