← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. content
  2. the gap round content
  3. 198
  4. 180
  5. border
  6. 334
  7. 190
  8. 206
  9. True
  10. 240
  11. margin
  12. the text or picture
  13. margin
  14. the line round the box
  15. 222
  16. 286
  17. 232
  18. 194
  19. 222
  20. 134
  21. 266
  22. 182
  23. 180
  24. padding
  25. True
  26. 224
  27. border
  28. False
  29. 250
  30. 206
  31. padding
  32. False
  33. 104
  34. 292
  35. 136
  36. True
  37. False
  38. the gap to other boxes
  39. False
  40. 122

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