← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 320
  2. padding
  3. padding
  4. 212
  5. 250
  6. the gap round content
  7. space outside the border
  8. the text or picture
  9. 118
  10. content
  11. False
  12. space inside the border
  13. 142
  14. the line round the box
  15. 248
  16. False
  17. 150
  18. False
  19. 190
  20. 318
  21. False
  22. 338
  23. margin
  24. 212
  25. margin
  26. False
  27. 104
  28. 258
  29. 332
  30. 172
  31. 114
  32. 218
  33. 210
  34. 216
  35. True
  36. True
  37. False
  38. True
  39. 308
  40. 192

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