← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. the text or picture
  3. False
  4. 148
  5. False
  6. content
  7. 158
  8. 232
  9. margin
  10. padding
  11. 78
  12. 142
  13. False
  14. border
  15. True
  16. 152
  17. 212
  18. False
  19. the line round the box
  20. 366
  21. 158
  22. 148
  23. False
  24. 86
  25. 170
  26. 110
  27. 346
  28. True
  29. True
  30. True
  31. the gap to other boxes
  32. border
  33. True
  34. 308
  35. 206
  36. 154
  37. 160
  38. 166
  39. 198
  40. 190

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