← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 112
  2. False
  3. 164
  4. the text or picture
  5. padding
  6. False
  7. 204
  8. False
  9. space outside the border
  10. 198
  11. the gap round content
  12. True
  13. border
  14. 336
  15. False
  16. 294
  17. 282
  18. 194
  19. content
  20. 334
  21. 118
  22. border
  23. 302
  24. False
  25. False
  26. padding
  27. the line round the box
  28. 202
  29. 128
  30. True
  31. False
  32. 268
  33. space inside the border
  34. 124
  35. False
  36. 172
  37. 230
  38. 274
  39. 80
  40. 182

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