← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. content
  2. True
  3. space outside the border
  4. 270
  5. False
  6. 128
  7. 170
  8. the text or picture
  9. 148
  10. padding
  11. True
  12. space inside the border
  13. the gap to other boxes
  14. 298
  15. 220
  16. padding
  17. 122
  18. 300
  19. 350
  20. True
  21. border
  22. a solid or dotted edge
  23. False
  24. False
  25. 196
  26. 94
  27. 124
  28. 110
  29. 188
  30. border
  31. 222
  32. 276
  33. 172
  34. 202
  35. False
  36. 212
  37. 124
  38. 222
  39. 158
  40. 202

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