← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 280
  2. border
  3. a solid or dotted edge
  4. 286
  5. True
  6. the gap round content
  7. 210
  8. the text or picture
  9. 136
  10. 180
  11. 130
  12. 260
  13. 222
  14. 286
  15. True
  16. the line round the box
  17. 264
  18. False
  19. space inside the border
  20. 218
  21. 164
  22. 232
  23. 118
  24. 300
  25. 332
  26. 172
  27. 240
  28. padding
  29. 336
  30. 200
  31. False
  32. False
  33. 96
  34. margin
  35. 206
  36. 234
  37. 198
  38. 154
  39. 194
  40. 256

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