← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 280
  2. space outside the border
  3. 154
  4. the text or picture
  5. 88
  6. a solid or dotted edge
  7. 312
  8. 96
  9. 182
  10. False
  11. margin
  12. space inside the border
  13. True
  14. 182
  15. True
  16. True
  17. False
  18. False
  19. border
  20. margin
  21. padding
  22. 160
  23. 142
  24. content
  25. 84
  26. 134
  27. 198
  28. 258
  29. 300
  30. True
  31. False
  32. the line round the box
  33. 184
  34. 180
  35. True
  36. border
  37. False
  38. 244
  39. 184
  40. 196

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