← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 198
  2. 100
  3. the text or picture
  4. 152
  5. margin
  6. 126
  7. 74
  8. space outside the border
  9. 172
  10. 206
  11. 226
  12. True
  13. False
  14. the gap round content
  15. 238
  16. space inside the border
  17. 212
  18. margin
  19. content
  20. 218
  21. 240
  22. border
  23. 284
  24. 144
  25. 352
  26. padding
  27. 140
  28. False
  29. 86
  30. 218
  31. 114
  32. False
  33. 124
  34. False
  35. 100
  36. 312
  37. padding
  38. 200
  39. a solid or dotted edge
  40. 226

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