← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. padding
  3. 100
  4. False
  5. False
  6. 298
  7. space outside the border
  8. margin
  9. 132
  10. 240
  11. 380
  12. 144
  13. 142
  14. 218
  15. False
  16. 94
  17. 220
  18. 112
  19. 262
  20. border
  21. content
  22. the gap to other boxes
  23. 188
  24. border
  25. False
  26. False
  27. a solid or dotted edge
  28. 252
  29. False
  30. 132
  31. True
  32. False
  33. 144
  34. False
  35. 216
  36. 272
  37. the gap round content
  38. 248
  39. 182
  40. 198

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