← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 254
  2. 154
  3. False
  4. 292
  5. the text or picture
  6. 136
  7. 208
  8. the gap to other boxes
  9. 172
  10. 158
  11. 86
  12. 296
  13. 242
  14. False
  15. 338
  16. a solid or dotted edge
  17. border
  18. 118
  19. 330
  20. 228
  21. True
  22. False
  23. 168
  24. 276
  25. 158
  26. 188
  27. 172
  28. 266
  29. False
  30. space outside the border
  31. content
  32. False
  33. 118
  34. True
  35. 124
  36. False
  37. 194
  38. border
  39. 298
  40. True

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