← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 118
  2. 124
  3. True
  4. True
  5. space inside the border
  6. padding
  7. 238
  8. border
  9. margin
  10. False
  11. margin
  12. True
  13. True
  14. 212
  15. 318
  16. 188
  17. False
  18. 210
  19. the line round the box
  20. padding
  21. 218
  22. 168
  23. the gap round content
  24. False
  25. 142
  26. 102
  27. the text or picture
  28. True
  29. 248
  30. 184
  31. False
  32. 286
  33. 286
  34. 136
  35. 130
  36. 344
  37. 124
  38. False
  39. 264
  40. 166

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