← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 90
  2. 154
  3. 138
  4. the text or picture
  5. False
  6. the line round the box
  7. space inside the border
  8. 296
  9. 264
  10. 212
  11. True
  12. 260
  13. 222
  14. 212
  15. True
  16. padding
  17. 132
  18. 228
  19. 354
  20. False
  21. True
  22. space outside the border
  23. border
  24. 122
  25. False
  26. True
  27. 158
  28. padding
  29. 318
  30. True
  31. 348
  32. False
  33. 84
  34. 80
  35. True
  36. 214
  37. a solid or dotted edge
  38. 142
  39. 242
  40. 142

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