← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. False
  3. 106
  4. 128
  5. 222
  6. content
  7. 226
  8. margin
  9. the gap to other boxes
  10. False
  11. the line round the box
  12. False
  13. the text or picture
  14. the gap round content
  15. True
  16. 188
  17. 72
  18. False
  19. 162
  20. 280
  21. False
  22. 164
  23. False
  24. a solid or dotted edge
  25. True
  26. margin
  27. border
  28. 84
  29. 238
  30. True
  31. False
  32. 134
  33. 326
  34. 240
  35. 144
  36. 174
  37. 82
  38. 282
  39. border
  40. 290

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