← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap to other boxes
  2. 134
  3. 140
  4. padding
  5. 122
  6. 344
  7. border
  8. the text or picture
  9. the line round the box
  10. 92
  11. 114
  12. space outside the border
  13. True
  14. True
  15. False
  16. the gap round content
  17. margin
  18. 66
  19. 240
  20. True
  21. 244
  22. 306
  23. content
  24. 294
  25. False
  26. 286
  27. 138
  28. False
  29. 212
  30. False
  31. True
  32. border
  33. 130
  34. margin
  35. 140
  36. 258
  37. padding
  38. False
  39. 204
  40. 120

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