← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 182
  3. padding
  4. 248
  5. 142
  6. border
  7. space inside the border
  8. True
  9. 184
  10. 336
  11. False
  12. 296
  13. margin
  14. 254
  15. the text or picture
  16. 342
  17. the gap round content
  18. padding
  19. margin
  20. 216
  21. True
  22. 134
  23. False
  24. 152
  25. 310
  26. the line round the box
  27. content
  28. 198
  29. False
  30. True
  31. 204
  32. 184
  33. 224
  34. a solid or dotted edge
  35. 152
  36. 242
  37. 322
  38. False
  39. False
  40. True

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