← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. border
  3. the gap round content
  4. border
  5. 338
  6. 112
  7. True
  8. True
  9. 352
  10. 204
  11. margin
  12. 170
  13. space inside the border
  14. True
  15. the gap to other boxes
  16. the text or picture
  17. 232
  18. False
  19. True
  20. False
  21. 294
  22. 204
  23. 168
  24. 154
  25. 84
  26. the line round the box
  27. 68
  28. False
  29. padding
  30. 292
  31. 238
  32. 138
  33. content
  34. a solid or dotted edge
  35. 220
  36. 230
  37. False
  38. 254
  39. False
  40. 130

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