← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. content
  2. 148
  3. False
  4. 232
  5. 188
  6. True
  7. 294
  8. padding
  9. margin
  10. True
  11. 118
  12. 198
  13. 322
  14. 276
  15. 274
  16. margin
  17. False
  18. 164
  19. 256
  20. 304
  21. the text or picture
  22. 184
  23. the gap to other boxes
  24. 122
  25. 370
  26. space outside the border
  27. 154
  28. 222
  29. 262
  30. False
  31. 262
  32. 274
  33. False
  34. 116
  35. 142
  36. 290
  37. 240
  38. border
  39. 170
  40. False

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