← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. 140
  3. content
  4. False
  5. 272
  6. border
  7. 226
  8. 308
  9. True
  10. 280
  11. 232
  12. 208
  13. space outside the border
  14. 160
  15. 118
  16. space inside the border
  17. 202
  18. the gap round content
  19. margin
  20. the text or picture
  21. padding
  22. 160
  23. 290
  24. True
  25. 170
  26. padding
  27. True
  28. 184
  29. the gap to other boxes
  30. False
  31. 150
  32. 252
  33. a solid or dotted edge
  34. True
  35. margin
  36. 320
  37. 86
  38. 102
  39. 216
  40. 162

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