← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 92
  3. space inside the border
  4. the text or picture
  5. margin
  6. False
  7. 206
  8. False
  9. border
  10. False
  11. padding
  12. space outside the border
  13. False
  14. 330
  15. False
  16. 124
  17. 166
  18. the gap to other boxes
  19. 314
  20. 158
  21. 240
  22. 200
  23. 256
  24. True
  25. 198
  26. content
  27. True
  28. the gap round content
  29. False
  30. 296
  31. border
  32. 154
  33. 86
  34. 176
  35. 222
  36. 288
  37. 106
  38. True
  39. False
  40. 198

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