← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 224
  2. 270
  3. 172
  4. content
  5. 140
  6. the text or picture
  7. 110
  8. 184
  9. 254
  10. padding
  11. 316
  12. the gap to other boxes
  13. border
  14. 262
  15. True
  16. border
  17. 298
  18. 126
  19. 328
  20. 122
  21. 322
  22. 98
  23. space inside the border
  24. 338
  25. False
  26. 228
  27. False
  28. 220
  29. 126
  30. 162
  31. 308
  32. space outside the border
  33. the gap round content
  34. a solid or dotted edge
  35. True
  36. 140
  37. 226
  38. 192
  39. True
  40. 188

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