← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 264
  2. margin
  3. padding
  4. the gap round content
  5. 286
  6. the line round the box
  7. 132
  8. 234
  9. margin
  10. 316
  11. 130
  12. 152
  13. 262
  14. 168
  15. 142
  16. the text or picture
  17. 284
  18. border
  19. 156
  20. padding
  21. 182
  22. space inside the border
  23. space outside the border
  24. the gap to other boxes
  25. 158
  26. 198
  27. 258
  28. 206
  29. 94
  30. 166
  31. 168
  32. False
  33. border
  34. True
  35. 168
  36. True
  37. True
  38. 124
  39. 246
  40. 92

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