← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. 294
  3. a solid or dotted edge
  4. False
  5. 128
  6. 292
  7. 78
  8. 336
  9. padding
  10. 244
  11. the gap to other boxes
  12. space outside the border
  13. 292
  14. True
  15. the line round the box
  16. content
  17. 166
  18. 90
  19. False
  20. 334
  21. margin
  22. 234
  23. True
  24. 156
  25. 158
  26. 92
  27. False
  28. space inside the border
  29. False
  30. True
  31. 98
  32. 98
  33. True
  34. the text or picture
  35. 262
  36. True
  37. 304
  38. margin
  39. 262
  40. 244

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