← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. False
  3. 352
  4. 288
  5. True
  6. 104
  7. 244
  8. the gap to other boxes
  9. the gap round content
  10. 274
  11. content
  12. border
  13. 188
  14. False
  15. 284
  16. padding
  17. 200
  18. 162
  19. space outside the border
  20. 106
  21. True
  22. 162
  23. the text or picture
  24. False
  25. 282
  26. 254
  27. False
  28. padding
  29. True
  30. 132
  31. 154
  32. False
  33. False
  34. 308
  35. 200
  36. a solid or dotted edge
  37. 152
  38. space inside the border
  39. False
  40. True

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