← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. margin
  3. padding
  4. False
  5. 96
  6. the gap to other boxes
  7. the line round the box
  8. 308
  9. True
  10. 160
  11. space inside the border
  12. 312
  13. True
  14. 198
  15. the text or picture
  16. True
  17. 104
  18. 238
  19. a solid or dotted edge
  20. 312
  21. 140
  22. border
  23. 108
  24. 332
  25. 170
  26. 234
  27. 274
  28. 210
  29. 138
  30. 236
  31. padding
  32. space outside the border
  33. 200
  34. 312
  35. 126
  36. 358
  37. 336
  38. True
  39. 280
  40. 260

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