← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 258
  2. False
  3. 72
  4. True
  5. 342
  6. 166
  7. 314
  8. space inside the border
  9. 282
  10. the line round the box
  11. 300
  12. padding
  13. 232
  14. 248
  15. True
  16. 72
  17. False
  18. 106
  19. 274
  20. 214
  21. the text or picture
  22. 138
  23. 266
  24. border
  25. True
  26. False
  27. content
  28. border
  29. the gap to other boxes
  30. 198
  31. margin
  32. True
  33. 292
  34. 154
  35. 190
  36. False
  37. 266
  38. 152
  39. True
  40. 112

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