← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. margin
  2. 238
  3. 252
  4. 292
  5. 122
  6. border
  7. False
  8. 260
  9. space outside the border
  10. the line round the box
  11. 268
  12. 344
  13. the gap to other boxes
  14. content
  15. 370
  16. 264
  17. the gap round content
  18. 274
  19. True
  20. 208
  21. a solid or dotted edge
  22. 158
  23. True
  24. padding
  25. True
  26. 288
  27. 286
  28. space inside the border
  29. 254
  30. 174
  31. False
  32. 130
  33. 82
  34. the text or picture
  35. padding
  36. 164
  37. 242
  38. 190
  39. margin
  40. 228

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