← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 248
  2. border
  3. border
  4. padding
  5. 236
  6. False
  7. space inside the border
  8. 148
  9. space outside the border
  10. margin
  11. 104
  12. True
  13. the line round the box
  14. the gap round content
  15. 268
  16. 224
  17. content
  18. 156
  19. the gap to other boxes
  20. 238
  21. 176
  22. 122
  23. the text or picture
  24. False
  25. False
  26. 116
  27. False
  28. 176
  29. 198
  30. True
  31. 342
  32. 224
  33. False
  34. 288
  35. a solid or dotted edge
  36. 206
  37. 252
  38. padding
  39. 344
  40. False

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