← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the text or picture
  2. border
  3. padding
  4. True
  5. space outside the border
  6. 256
  7. False
  8. 192
  9. margin
  10. 246
  11. 244
  12. 178
  13. a solid or dotted edge
  14. 134
  15. True
  16. border
  17. the gap to other boxes
  18. 114
  19. 246
  20. True
  21. False
  22. 142
  23. 172
  24. 180
  25. True
  26. 124
  27. False
  28. 112
  29. 156
  30. 164
  31. 254
  32. 202
  33. the gap round content
  34. 192
  35. 156
  36. 168
  37. False
  38. 298
  39. 172
  40. margin

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