← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 166
  2. True
  3. the text or picture
  4. False
  5. margin
  6. 82
  7. 114
  8. False
  9. space inside the border
  10. True
  11. True
  12. 254
  13. 274
  14. the gap to other boxes
  15. 216
  16. the line round the box
  17. 174
  18. 156
  19. 330
  20. 128
  21. 254
  22. space outside the border
  23. content
  24. 220
  25. False
  26. padding
  27. 142
  28. False
  29. 128
  30. False
  31. False
  32. True
  33. 250
  34. the gap round content
  35. margin
  36. 350
  37. 194
  38. True
  39. a solid or dotted edge
  40. border

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