← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. a solid or dotted edge
  3. True
  4. the line round the box
  5. 156
  6. True
  7. 332
  8. 208
  9. 270
  10. True
  11. 214
  12. True
  13. True
  14. 210
  15. 124
  16. False
  17. content
  18. 248
  19. margin
  20. space outside the border
  21. 264
  22. 184
  23. 138
  24. 144
  25. False
  26. False
  27. 220
  28. False
  29. 168
  30. 154
  31. False
  32. 168
  33. 246
  34. 196
  35. 142
  36. 104
  37. 152
  38. 286
  39. 144
  40. 170

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