← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. border
  3. space inside the border
  4. 316
  5. 168
  6. True
  7. border
  8. 248
  9. 112
  10. 234
  11. padding
  12. 114
  13. True
  14. True
  15. the gap to other boxes
  16. False
  17. the gap round content
  18. a solid or dotted edge
  19. False
  20. 282
  21. False
  22. content
  23. 180
  24. margin
  25. 164
  26. space outside the border
  27. False
  28. True
  29. False
  30. 156
  31. 130
  32. 164
  33. False
  34. True
  35. padding
  36. 162
  37. 164
  38. 348
  39. 142
  40. 102

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