← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 336
  3. margin
  4. the gap round content
  5. padding
  6. padding
  7. the line round the box
  8. False
  9. content
  10. 172
  11. 286
  12. 196
  13. the text or picture
  14. 116
  15. 358
  16. 282
  17. 136
  18. margin
  19. 246
  20. border
  21. 186
  22. a solid or dotted edge
  23. True
  24. True
  25. False
  26. 354
  27. 362
  28. space outside the border
  29. True
  30. 214
  31. 138
  32. the gap to other boxes
  33. False
  34. 160
  35. 294
  36. 336
  37. 166
  38. 388
  39. space inside the border
  40. 138

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