← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the line round the box
  2. 202
  3. content
  4. margin
  5. False
  6. the text or picture
  7. the gap to other boxes
  8. space inside the border
  9. False
  10. 228
  11. 178
  12. 134
  13. 94
  14. padding
  15. border
  16. margin
  17. True
  18. the gap round content
  19. True
  20. 170
  21. 254
  22. 312
  23. space outside the border
  24. 158
  25. False
  26. 292
  27. 98
  28. 164
  29. False
  30. 298
  31. False
  32. True
  33. 304
  34. False
  35. True
  36. False
  37. 146
  38. 220
  39. 252
  40. 112

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