← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 160
  2. 218
  3. 182
  4. margin
  5. True
  6. the gap round content
  7. the text or picture
  8. the gap to other boxes
  9. padding
  10. 270
  11. 158
  12. a solid or dotted edge
  13. 274
  14. True
  15. content
  16. 314
  17. 238
  18. border
  19. True
  20. 178
  21. 166
  22. 166
  23. space outside the border
  24. 286
  25. 136
  26. 326
  27. 330
  28. 228
  29. 180
  30. 76
  31. border
  32. False
  33. 318
  34. True
  35. 180
  36. 212
  37. 130
  38. True
  39. 102
  40. 340

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