← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 176
  3. 176
  4. space outside the border
  5. 374
  6. margin
  7. content
  8. True
  9. False
  10. 68
  11. a solid or dotted edge
  12. True
  13. 100
  14. the text or picture
  15. 226
  16. 182
  17. 128
  18. 200
  19. False
  20. space inside the border
  21. False
  22. 158
  23. 184
  24. margin
  25. 112
  26. False
  27. 314
  28. True
  29. 274
  30. the gap to other boxes
  31. 130
  32. 102
  33. True
  34. 360
  35. 136
  36. 172
  37. 140
  38. True
  39. 164
  40. padding

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