← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. padding
  3. border
  4. margin
  5. False
  6. 114
  7. space inside the border
  8. False
  9. False
  10. the text or picture
  11. True
  12. 100
  13. 198
  14. True
  15. content
  16. the gap round content
  17. a solid or dotted edge
  18. the line round the box
  19. 140
  20. 328
  21. False
  22. 228
  23. 248
  24. True
  25. 68
  26. 332
  27. 110
  28. 232
  29. space outside the border
  30. 332
  31. 232
  32. False
  33. 176
  34. False
  35. 224
  36. padding
  37. border
  38. 152
  39. True
  40. False

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