← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. space outside the border
  3. 292
  4. False
  5. 168
  6. padding
  7. the text or picture
  8. space inside the border
  9. True
  10. margin
  11. 314
  12. the gap to other boxes
  13. 168
  14. True
  15. 178
  16. 148
  17. 104
  18. 272
  19. a solid or dotted edge
  20. 220
  21. 126
  22. 258
  23. True
  24. 256
  25. 150
  26. 136
  27. True
  28. 184
  29. the gap round content
  30. 360
  31. 192
  32. 290
  33. border
  34. 250
  35. 202
  36. 152
  37. False
  38. padding
  39. 154
  40. 142

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