← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. 368
  3. 290
  4. margin
  5. 296
  6. 168
  7. True
  8. False
  9. the text or picture
  10. 258
  11. 224
  12. space inside the border
  13. 240
  14. the gap to other boxes
  15. False
  16. margin
  17. space outside the border
  18. 52
  19. 92
  20. padding
  21. border
  22. 300
  23. 124
  24. 140
  25. 310
  26. border
  27. 232
  28. 192
  29. 128
  30. 98
  31. 176
  32. 196
  33. 186
  34. 200
  35. 160
  36. 292
  37. False
  38. 158
  39. True
  40. 76

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