← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 124
  2. padding
  3. False
  4. False
  5. 236
  6. True
  7. the text or picture
  8. 328
  9. 342
  10. the gap round content
  11. 214
  12. 122
  13. content
  14. padding
  15. 258
  16. space outside the border
  17. True
  18. 248
  19. 102
  20. 362
  21. margin
  22. 368
  23. 294
  24. True
  25. border
  26. False
  27. border
  28. 168
  29. False
  30. 234
  31. 146
  32. 180
  33. False
  34. 242
  35. 80
  36. the line round the box
  37. the gap to other boxes
  38. 100
  39. 178
  40. True

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