← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. the text or picture
  3. 136
  4. False
  5. True
  6. True
  7. a solid or dotted edge
  8. False
  9. padding
  10. 188
  11. 238
  12. 160
  13. 246
  14. 138
  15. True
  16. 136
  17. margin
  18. 184
  19. space inside the border
  20. 308
  21. 216
  22. 320
  23. 272
  24. 144
  25. False
  26. 142
  27. 114
  28. 134
  29. 186
  30. 116
  31. 184
  32. 212
  33. content
  34. 200
  35. 100
  36. 168
  37. 292
  38. space outside the border
  39. 214
  40. the line round the box

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