← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. False
  3. 312
  4. the text or picture
  5. 224
  6. 274
  7. True
  8. 156
  9. True
  10. margin
  11. True
  12. content
  13. 264
  14. True
  15. 220
  16. margin
  17. 232
  18. 242
  19. False
  20. False
  21. 326
  22. 124
  23. border
  24. 86
  25. a solid or dotted edge
  26. False
  27. 218
  28. padding
  29. 160
  30. 390
  31. True
  32. space inside the border
  33. 316
  34. 200
  35. 184
  36. 356
  37. 264
  38. 348
  39. 322
  40. space outside the border

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