← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 244
  2. 168
  3. True
  4. padding
  5. True
  6. False
  7. 184
  8. 166
  9. True
  10. 188
  11. border
  12. True
  13. 270
  14. False
  15. padding
  16. 184
  17. margin
  18. 258
  19. the gap round content
  20. 98
  21. False
  22. margin
  23. space outside the border
  24. 170
  25. 190
  26. 74
  27. 198
  28. True
  29. the text or picture
  30. 132
  31. 158
  32. a solid or dotted edge
  33. 124
  34. space inside the border
  35. 290
  36. 238
  37. 270
  38. border
  39. False
  40. 108

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