← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 232
  2. True
  3. padding
  4. margin
  5. True
  6. 128
  7. True
  8. True
  9. the text or picture
  10. the gap round content
  11. 212
  12. 220
  13. False
  14. 254
  15. 296
  16. 234
  17. 138
  18. False
  19. border
  20. 210
  21. False
  22. 100
  23. space inside the border
  24. True
  25. False
  26. space outside the border
  27. 192
  28. True
  29. False
  30. 254
  31. False
  32. 208
  33. 112
  34. 276
  35. content
  36. margin
  37. 232
  38. 262
  39. 212
  40. 168

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