← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 368
  2. 170
  3. the line round the box
  4. 130
  5. 102
  6. content
  7. False
  8. True
  9. False
  10. 196
  11. a solid or dotted edge
  12. space outside the border
  13. the text or picture
  14. True
  15. 194
  16. True
  17. 170
  18. 224
  19. padding
  20. the gap round content
  21. 348
  22. False
  23. margin
  24. 378
  25. 92
  26. False
  27. 84
  28. True
  29. 282
  30. 200
  31. 166
  32. 150
  33. True
  34. 262
  35. 352
  36. 146
  37. 200
  38. 126
  39. 178
  40. 260

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