← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 342
  2. border
  3. 96
  4. space outside the border
  5. 256
  6. True
  7. True
  8. 124
  9. False
  10. the gap to other boxes
  11. border
  12. padding
  13. False
  14. True
  15. margin
  16. 166
  17. 272
  18. 314
  19. 232
  20. 140
  21. 150
  22. 224
  23. 156
  24. 248
  25. False
  26. 124
  27. True
  28. 132
  29. the line round the box
  30. 192
  31. False
  32. 156
  33. the text or picture
  34. 192
  35. True
  36. 256
  37. 102
  38. content
  39. False
  40. 296

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