← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 262
  2. 160
  3. the gap to other boxes
  4. 166
  5. margin
  6. False
  7. 230
  8. False
  9. 204
  10. the text or picture
  11. False
  12. border
  13. a solid or dotted edge
  14. 184
  15. padding
  16. 258
  17. space inside the border
  18. 146
  19. 88
  20. 220
  21. space outside the border
  22. 294
  23. 308
  24. content
  25. padding
  26. True
  27. True
  28. False
  29. 274
  30. 336
  31. 106
  32. the gap round content
  33. 148
  34. False
  35. 134
  36. 250
  37. 218
  38. 156
  39. 208
  40. 160

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