← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 110
  2. 140
  3. margin
  4. False
  5. False
  6. False
  7. the gap to other boxes
  8. border
  9. 268
  10. False
  11. margin
  12. 262
  13. 258
  14. True
  15. False
  16. 156
  17. 154
  18. content
  19. 168
  20. a solid or dotted edge
  21. padding
  22. the line round the box
  23. False
  24. padding
  25. 184
  26. 200
  27. 180
  28. 182
  29. 188
  30. 362
  31. space outside the border
  32. space inside the border
  33. 266
  34. 230
  35. the gap round content
  36. 204
  37. False
  38. 272
  39. 98
  40. the text or picture

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