← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 166
  2. 282
  3. 164
  4. margin
  5. 146
  6. 160
  7. content
  8. space inside the border
  9. a solid or dotted edge
  10. 274
  11. the gap round content
  12. border
  13. the line round the box
  14. True
  15. 268
  16. 218
  17. 138
  18. 200
  19. 220
  20. 142
  21. 110
  22. False
  23. margin
  24. True
  25. 124
  26. 278
  27. the text or picture
  28. 192
  29. 174
  30. 108
  31. padding
  32. 202
  33. 110
  34. 106
  35. 228
  36. False
  37. False
  38. 74
  39. space outside the border
  40. padding

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