← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the line round the box
  2. the text or picture
  3. 150
  4. space outside the border
  5. 208
  6. margin
  7. 94
  8. space inside the border
  9. border
  10. 332
  11. 134
  12. border
  13. 274
  14. the gap to other boxes
  15. 124
  16. padding
  17. 86
  18. 90
  19. 240
  20. True
  21. the gap round content
  22. 302
  23. True
  24. True
  25. 312
  26. 254
  27. 86
  28. 172
  29. 182
  30. 336
  31. a solid or dotted edge
  32. False
  33. 292
  34. content
  35. 244
  36. 202
  37. 152
  38. False
  39. True
  40. True

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