← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. space inside the border
  3. the text or picture
  4. the gap to other boxes
  5. 116
  6. 292
  7. False
  8. 274
  9. 208
  10. 192
  11. a solid or dotted edge
  12. True
  13. 132
  14. True
  15. False
  16. 350
  17. border
  18. 280
  19. the line round the box
  20. margin
  21. 166
  22. 164
  23. the gap round content
  24. 240
  25. 116
  26. 180
  27. margin
  28. 214
  29. 310
  30. 102
  31. space outside the border
  32. 250
  33. 324
  34. 168
  35. 314
  36. 208
  37. 152
  38. border
  39. 274
  40. 242

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