← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 160
  2. 188
  3. 248
  4. content
  5. space inside the border
  6. margin
  7. 340
  8. True
  9. True
  10. 144
  11. padding
  12. 158
  13. padding
  14. 302
  15. a solid or dotted edge
  16. 340
  17. 148
  18. 388
  19. the text or picture
  20. False
  21. 362
  22. 170
  23. 260
  24. 264
  25. False
  26. margin
  27. the line round the box
  28. 222
  29. 198
  30. 132
  31. True
  32. 96
  33. 174
  34. space outside the border
  35. 206
  36. 320
  37. False
  38. 280
  39. False
  40. 210

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