← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 80
  2. border
  3. 72
  4. padding
  5. the text or picture
  6. False
  7. 90
  8. the gap round content
  9. True
  10. True
  11. 276
  12. 200
  13. border
  14. 266
  15. False
  16. 240
  17. True
  18. margin
  19. 178
  20. 174
  21. space inside the border
  22. space outside the border
  23. True
  24. 224
  25. 168
  26. 164
  27. padding
  28. 184
  29. the gap to other boxes
  30. 196
  31. 152
  32. 154
  33. 276
  34. False
  35. 130
  36. False
  37. 226
  38. margin
  39. 114
  40. 264

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