← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. margin
  3. 150
  4. 94
  5. margin
  6. True
  7. 318
  8. border
  9. the gap to other boxes
  10. 292
  11. 238
  12. a solid or dotted edge
  13. 138
  14. 208
  15. False
  16. the text or picture
  17. 364
  18. 328
  19. 358
  20. the gap round content
  21. False
  22. content
  23. 156
  24. the line round the box
  25. 164
  26. False
  27. 202
  28. 142
  29. 164
  30. 346
  31. 280
  32. border
  33. 164
  34. False
  35. 212
  36. True
  37. 106
  38. False
  39. padding
  40. 192

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