← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. content
  3. 282
  4. margin
  5. 284
  6. False
  7. 226
  8. padding
  9. 190
  10. 124
  11. a solid or dotted edge
  12. 122
  13. False
  14. False
  15. True
  16. border
  17. 104
  18. 162
  19. the gap round content
  20. 192
  21. 258
  22. 162
  23. 136
  24. False
  25. False
  26. the text or picture
  27. False
  28. space inside the border
  29. False
  30. 98
  31. 316
  32. True
  33. margin
  34. the line round the box
  35. 286
  36. 120
  37. 230
  38. the gap to other boxes
  39. False
  40. 200

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