← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 178
  2. margin
  3. True
  4. False
  5. 296
  6. the text or picture
  7. 226
  8. 138
  9. 202
  10. the gap to other boxes
  11. False
  12. space inside the border
  13. 194
  14. True
  15. True
  16. 162
  17. space outside the border
  18. 280
  19. border
  20. 86
  21. the line round the box
  22. 82
  23. 104
  24. a solid or dotted edge
  25. 126
  26. 268
  27. 136
  28. 312
  29. 158
  30. 256
  31. False
  32. 184
  33. False
  34. margin
  35. 272
  36. 152
  37. False
  38. 260
  39. 142
  40. 66

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