← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 140
  2. space outside the border
  3. 230
  4. border
  5. 286
  6. 146
  7. margin
  8. the gap round content
  9. False
  10. the text or picture
  11. 260
  12. padding
  13. margin
  14. 134
  15. False
  16. the line round the box
  17. 72
  18. True
  19. 244
  20. 314
  21. content
  22. 178
  23. True
  24. 166
  25. 176
  26. space inside the border
  27. 192
  28. 196
  29. False
  30. a solid or dotted edge
  31. False
  32. border
  33. 152
  34. 174
  35. 202
  36. True
  37. 208
  38. 330
  39. True
  40. 334

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