← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space inside the border
  2. 332
  3. 142
  4. content
  5. padding
  6. 252
  7. the line round the box
  8. False
  9. 132
  10. 266
  11. True
  12. 216
  13. 240
  14. True
  15. 280
  16. 170
  17. 264
  18. True
  19. 184
  20. the gap round content
  21. 274
  22. 206
  23. 180
  24. 266
  25. 126
  26. 142
  27. 104
  28. border
  29. False
  30. space outside the border
  31. 236
  32. 342
  33. 84
  34. margin
  35. False
  36. 182
  37. border
  38. a solid or dotted edge
  39. 198
  40. 224

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