← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 280
  2. True
  3. 274
  4. a solid or dotted edge
  5. False
  6. 218
  7. margin
  8. 164
  9. 246
  10. 142
  11. the gap to other boxes
  12. False
  13. 240
  14. the text or picture
  15. margin
  16. 104
  17. 200
  18. 160
  19. 302
  20. 182
  21. False
  22. False
  23. False
  24. space outside the border
  25. True
  26. 94
  27. padding
  28. False
  29. True
  30. 76
  31. 356
  32. 322
  33. True
  34. padding
  35. 334
  36. 234
  37. 246
  38. 286
  39. 204
  40. the line round the box

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