← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. the line round the box
  3. 236
  4. True
  5. 78
  6. 154
  7. padding
  8. space inside the border
  9. space outside the border
  10. 194
  11. True
  12. border
  13. margin
  14. 202
  15. 296
  16. 136
  17. True
  18. False
  19. a solid or dotted edge
  20. 164
  21. False
  22. 278
  23. False
  24. True
  25. content
  26. True
  27. 62
  28. 112
  29. margin
  30. 120
  31. 178
  32. 264
  33. 136
  34. 258
  35. the gap round content
  36. 84
  37. 314
  38. 248
  39. the gap to other boxes
  40. 182

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