← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. space inside the border
  3. 290
  4. 320
  5. 136
  6. 304
  7. 228
  8. border
  9. 240
  10. content
  11. margin
  12. 200
  13. True
  14. the text or picture
  15. space outside the border
  16. 94
  17. 108
  18. 314
  19. the gap to other boxes
  20. True
  21. 232
  22. False
  23. 384
  24. 130
  25. 160
  26. the line round the box
  27. 156
  28. 220
  29. padding
  30. 128
  31. 200
  32. 196
  33. False
  34. 154
  35. 164
  36. True
  37. False
  38. a solid or dotted edge
  39. False
  40. margin

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