← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 330
  3. margin
  4. the gap round content
  5. 164
  6. 202
  7. margin
  8. True
  9. space inside the border
  10. 98
  11. 222
  12. 266
  13. 134
  14. 202
  15. False
  16. True
  17. the text or picture
  18. 358
  19. 208
  20. 100
  21. 186
  22. border
  23. space outside the border
  24. padding
  25. 198
  26. False
  27. 218
  28. 240
  29. False
  30. 268
  31. 274
  32. True
  33. 102
  34. 356
  35. 164
  36. 382
  37. False
  38. False
  39. 104
  40. True

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