← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 142
  2. True
  3. margin
  4. 236
  5. 338
  6. border
  7. the line round the box
  8. False
  9. 190
  10. True
  11. padding
  12. 84
  13. a solid or dotted edge
  14. 178
  15. border
  16. False
  17. 94
  18. 256
  19. 342
  20. 138
  21. 228
  22. False
  23. 130
  24. 146
  25. 176
  26. True
  27. the gap round content
  28. False
  29. 146
  30. True
  31. False
  32. 196
  33. 222
  34. False
  35. 164
  36. the gap to other boxes
  37. space inside the border
  38. 206
  39. False
  40. 316

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