← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 210
  2. True
  3. True
  4. border
  5. 346
  6. False
  7. 90
  8. 80
  9. margin
  10. margin
  11. 296
  12. 254
  13. 198
  14. True
  15. border
  16. padding
  17. 264
  18. the text or picture
  19. True
  20. space outside the border
  21. False
  22. False
  23. 188
  24. 156
  25. the gap round content
  26. the gap to other boxes
  27. 280
  28. 270
  29. 374
  30. 186
  31. a solid or dotted edge
  32. 122
  33. False
  34. 284
  35. 360
  36. 276
  37. False
  38. 134
  39. padding
  40. True

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