← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. the text or picture
  3. content
  4. the gap round content
  5. True
  6. 104
  7. space outside the border
  8. 182
  9. 158
  10. 166
  11. 92
  12. 94
  13. border
  14. 198
  15. 244
  16. 286
  17. False
  18. a solid or dotted edge
  19. 294
  20. margin
  21. False
  22. border
  23. False
  24. the gap to other boxes
  25. 96
  26. 242
  27. True
  28. 204
  29. True
  30. 198
  31. 212
  32. 234
  33. 110
  34. 320
  35. True
  36. 92
  37. False
  38. 268
  39. margin
  40. 150

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