← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the line round the box
  2. False
  3. True
  4. the gap round content
  5. 298
  6. 172
  7. 336
  8. False
  9. True
  10. False
  11. content
  12. 322
  13. 178
  14. 242
  15. 94
  16. padding
  17. 286
  18. space outside the border
  19. a solid or dotted edge
  20. False
  21. border
  22. 302
  23. False
  24. the gap to other boxes
  25. 142
  26. the text or picture
  27. 110
  28. space inside the border
  29. padding
  30. 92
  31. margin
  32. 134
  33. True
  34. 134
  35. 282
  36. 332
  37. 180
  38. False
  39. border
  40. 122

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