← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 154
  3. space outside the border
  4. False
  5. True
  6. 148
  7. 108
  8. border
  9. 110
  10. padding
  11. 266
  12. 264
  13. 172
  14. True
  15. margin
  16. 278
  17. 156
  18. the text or picture
  19. False
  20. the gap to other boxes
  21. False
  22. 100
  23. 224
  24. 202
  25. 82
  26. 128
  27. 240
  28. 248
  29. space inside the border
  30. 216
  31. 196
  32. 136
  33. 320
  34. 286
  35. 92
  36. False
  37. margin
  38. True
  39. a solid or dotted edge
  40. the gap round content

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