← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the text or picture
  2. content
  3. 210
  4. the gap to other boxes
  5. margin
  6. True
  7. 202
  8. space inside the border
  9. 338
  10. 302
  11. 284
  12. 340
  13. True
  14. 148
  15. 312
  16. a solid or dotted edge
  17. False
  18. 238
  19. 220
  20. 158
  21. False
  22. padding
  23. border
  24. False
  25. 96
  26. False
  27. 144
  28. 204
  29. 250
  30. 202
  31. margin
  32. 106
  33. 168
  34. 298
  35. the line round the box
  36. False
  37. 78
  38. space outside the border
  39. 144
  40. the gap round content

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