← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. False
  3. 130
  4. content
  5. 104
  6. padding
  7. 202
  8. 238
  9. False
  10. False
  11. False
  12. 174
  13. 164
  14. True
  15. 232
  16. the text or picture
  17. 282
  18. 246
  19. 212
  20. 202
  21. the line round the box
  22. 298
  23. True
  24. 270
  25. False
  26. False
  27. the gap to other boxes
  28. the gap round content
  29. space outside the border
  30. margin
  31. space inside the border
  32. a solid or dotted edge
  33. True
  34. padding
  35. 226
  36. 214
  37. 214
  38. False
  39. 250
  40. 316

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