← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 248
  2. the text or picture
  3. 210
  4. 138
  5. padding
  6. padding
  7. False
  8. 250
  9. True
  10. content
  11. True
  12. a solid or dotted edge
  13. 190
  14. False
  15. 296
  16. False
  17. 318
  18. margin
  19. 154
  20. the gap round content
  21. 264
  22. 292
  23. True
  24. 276
  25. 254
  26. 230
  27. 166
  28. 76
  29. the gap to other boxes
  30. 252
  31. True
  32. 190
  33. 294
  34. 98
  35. 198
  36. True
  37. space inside the border
  38. 214
  39. 170
  40. 268

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