← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 184
  3. 92
  4. border
  5. 152
  6. 244
  7. 366
  8. space outside the border
  9. 244
  10. margin
  11. the text or picture
  12. 254
  13. margin
  14. 214
  15. True
  16. False
  17. 256
  18. 258
  19. False
  20. 140
  21. border
  22. 292
  23. a solid or dotted edge
  24. space inside the border
  25. 368
  26. 58
  27. padding
  28. the gap to other boxes
  29. 214
  30. 226
  31. 212
  32. False
  33. the gap round content
  34. True
  35. 306
  36. True
  37. 122
  38. 254
  39. 294
  40. the line round the box

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