← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 276
  2. False
  3. a solid or dotted edge
  4. 150
  5. 316
  6. content
  7. False
  8. 132
  9. False
  10. margin
  11. 242
  12. the line round the box
  13. 176
  14. the text or picture
  15. True
  16. False
  17. 160
  18. 216
  19. 176
  20. 192
  21. 168
  22. 114
  23. padding
  24. the gap to other boxes
  25. space inside the border
  26. 156
  27. 276
  28. False
  29. 188
  30. True
  31. padding
  32. 100
  33. 94
  34. True
  35. 118
  36. 206
  37. 122
  38. True
  39. 166
  40. 236

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