← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 134
  3. 96
  4. margin
  5. True
  6. 248
  7. the gap round content
  8. 170
  9. 282
  10. True
  11. True
  12. 286
  13. 216
  14. space inside the border
  15. border
  16. the gap to other boxes
  17. 62
  18. 362
  19. 284
  20. 152
  21. border
  22. 96
  23. 72
  24. False
  25. True
  26. 174
  27. the line round the box
  28. 308
  29. 180
  30. 244
  31. 150
  32. 184
  33. False
  34. False
  35. True
  36. padding
  37. 368
  38. 232
  39. 130
  40. 188

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