← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 316
  2. True
  3. False
  4. 192
  5. the text or picture
  6. padding
  7. True
  8. 144
  9. 290
  10. 282
  11. 216
  12. True
  13. 356
  14. padding
  15. 228
  16. False
  17. the line round the box
  18. 248
  19. content
  20. 94
  21. space outside the border
  22. the gap round content
  23. True
  24. a solid or dotted edge
  25. False
  26. 318
  27. 202
  28. 350
  29. 130
  30. 152
  31. False
  32. False
  33. border
  34. 70
  35. False
  36. the gap to other boxes
  37. margin
  38. 200
  39. margin
  40. border

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