← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 128
  2. the gap to other boxes
  3. 72
  4. the text or picture
  5. 272
  6. 198
  7. False
  8. padding
  9. 160
  10. False
  11. border
  12. False
  13. the gap round content
  14. False
  15. 268
  16. False
  17. a solid or dotted edge
  18. 182
  19. the line round the box
  20. 148
  21. 334
  22. 96
  23. padding
  24. 134
  25. 214
  26. 364
  27. 214
  28. 202
  29. margin
  30. 304
  31. border
  32. False
  33. 162
  34. 204
  35. 244
  36. 210
  37. 252
  38. 282
  39. space inside the border
  40. False

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