← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. padding
  3. 88
  4. margin
  5. the text or picture
  6. 132
  7. 88
  8. 176
  9. the gap round content
  10. border
  11. 98
  12. 246
  13. 184
  14. 260
  15. False
  16. 366
  17. 148
  18. False
  19. space outside the border
  20. margin
  21. space inside the border
  22. 304
  23. 168
  24. padding
  25. 222
  26. 158
  27. 232
  28. True
  29. 90
  30. True
  31. False
  32. 224
  33. 72
  34. 152
  35. False
  36. 90
  37. 272
  38. 152
  39. content
  40. a solid or dotted edge

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