← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. 254
  3. 196
  4. 186
  5. 226
  6. 330
  7. margin
  8. the text or picture
  9. True
  10. border
  11. True
  12. the gap round content
  13. 292
  14. border
  15. True
  16. False
  17. 164
  18. True
  19. False
  20. 354
  21. padding
  22. a solid or dotted edge
  23. space inside the border
  24. the line round the box
  25. 224
  26. False
  27. False
  28. 286
  29. padding
  30. 164
  31. 184
  32. 230
  33. 202
  34. 126
  35. 190
  36. 120
  37. 268
  38. 144
  39. 108
  40. 298

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