← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. False
  3. margin
  4. 164
  5. the gap to other boxes
  6. 72
  7. 254
  8. 234
  9. True
  10. 190
  11. border
  12. 112
  13. 184
  14. 146
  15. border
  16. the line round the box
  17. 114
  18. 106
  19. 238
  20. padding
  21. 166
  22. 320
  23. 122
  24. 142
  25. 138
  26. True
  27. 166
  28. 166
  29. 206
  30. True
  31. 96
  32. space outside the border
  33. 186
  34. 142
  35. 226
  36. the text or picture
  37. False
  38. True
  39. 190
  40. 210

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