← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 232
  2. the gap to other boxes
  3. False
  4. False
  5. 224
  6. 138
  7. 124
  8. padding
  9. 312
  10. False
  11. the gap round content
  12. content
  13. 286
  14. 172
  15. 128
  16. space outside the border
  17. margin
  18. margin
  19. a solid or dotted edge
  20. 372
  21. border
  22. 278
  23. border
  24. 332
  25. True
  26. 244
  27. False
  28. 314
  29. 126
  30. 284
  31. True
  32. 100
  33. 144
  34. 234
  35. False
  36. padding
  37. True
  38. 162
  39. 128
  40. 316

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