← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 340
  2. the gap to other boxes
  3. padding
  4. 314
  5. True
  6. 144
  7. 130
  8. padding
  9. 288
  10. a solid or dotted edge
  11. 392
  12. False
  13. the text or picture
  14. True
  15. 168
  16. border
  17. margin
  18. False
  19. 156
  20. 114
  21. True
  22. 104
  23. 352
  24. 358
  25. the line round the box
  26. 254
  27. 200
  28. 116
  29. 244
  30. False
  31. margin
  32. True
  33. 294
  34. 62
  35. 296
  36. space outside the border
  37. True
  38. content
  39. 190
  40. 238

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