← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 178
  2. padding
  3. 246
  4. 340
  5. the gap round content
  6. 152
  7. the text or picture
  8. True
  9. the line round the box
  10. 248
  11. False
  12. 200
  13. space outside the border
  14. space inside the border
  15. 142
  16. 88
  17. False
  18. 196
  19. 90
  20. 348
  21. True
  22. False
  23. the gap to other boxes
  24. 222
  25. 174
  26. 166
  27. 66
  28. False
  29. border
  30. padding
  31. 280
  32. 266
  33. 238
  34. False
  35. a solid or dotted edge
  36. False
  37. border
  38. True
  39. 236
  40. 246

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