← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. True
  3. the text or picture
  4. 244
  5. content
  6. 198
  7. False
  8. 236
  9. False
  10. a solid or dotted edge
  11. 238
  12. 194
  13. 248
  14. 244
  15. False
  16. 256
  17. padding
  18. 104
  19. 104
  20. 172
  21. margin
  22. the gap to other boxes
  23. 158
  24. 156
  25. border
  26. 264
  27. 262
  28. True
  29. the gap round content
  30. 302
  31. 164
  32. False
  33. 162
  34. 276
  35. True
  36. 268
  37. 238
  38. True
  39. 300
  40. True

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