← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 370
  2. False
  3. True
  4. 240
  5. 236
  6. border
  7. a solid or dotted edge
  8. False
  9. 84
  10. True
  11. 224
  12. 112
  13. the gap round content
  14. False
  15. space outside the border
  16. False
  17. False
  18. the line round the box
  19. 162
  20. 244
  21. 154
  22. 226
  23. 286
  24. 156
  25. 314
  26. content
  27. 300
  28. the text or picture
  29. 288
  30. 284
  31. padding
  32. 158
  33. 218
  34. 184
  35. padding
  36. 170
  37. False
  38. 96
  39. margin
  40. space inside the border

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