← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 146
  2. the text or picture
  3. 166
  4. margin
  5. border
  6. 364
  7. border
  8. 114
  9. space outside the border
  10. 206
  11. 134
  12. a solid or dotted edge
  13. 118
  14. 334
  15. content
  16. 174
  17. padding
  18. False
  19. 150
  20. 158
  21. 128
  22. 328
  23. 84
  24. space inside the border
  25. 192
  26. 118
  27. 282
  28. 344
  29. 232
  30. 148
  31. 160
  32. False
  33. True
  34. 110
  35. False
  36. 148
  37. padding
  38. 178
  39. True
  40. the gap round content

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