← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 250
  3. margin
  4. 184
  5. the text or picture
  6. 214
  7. 120
  8. the gap to other boxes
  9. 72
  10. 236
  11. 318
  12. True
  13. padding
  14. 274
  15. 280
  16. False
  17. 212
  18. space inside the border
  19. the line round the box
  20. False
  21. 172
  22. False
  23. 270
  24. 262
  25. border
  26. 144
  27. 270
  28. 102
  29. 336
  30. 182
  31. 252
  32. 200
  33. False
  34. content
  35. 180
  36. 216
  37. a solid or dotted edge
  38. True
  39. 232
  40. 184

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