← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 122
  3. the gap round content
  4. 222
  5. content
  6. 294
  7. the text or picture
  8. False
  9. 124
  10. the line round the box
  11. True
  12. True
  13. 108
  14. True
  15. 124
  16. space inside the border
  17. padding
  18. 102
  19. 318
  20. True
  21. border
  22. True
  23. margin
  24. margin
  25. space outside the border
  26. 84
  27. 148
  28. 142
  29. 170
  30. True
  31. 98
  32. 206
  33. a solid or dotted edge
  34. 206
  35. False
  36. False
  37. 174
  38. 76
  39. 206
  40. 196

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