← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 320
  2. 98
  3. 242
  4. border
  5. padding
  6. margin
  7. 164
  8. 104
  9. False
  10. space outside the border
  11. padding
  12. 340
  13. 206
  14. False
  15. 210
  16. 316
  17. True
  18. 136
  19. True
  20. a solid or dotted edge
  21. True
  22. 338
  23. 160
  24. False
  25. False
  26. space inside the border
  27. 230
  28. margin
  29. 296
  30. 152
  31. 206
  32. 172
  33. 278
  34. 266
  35. 114
  36. the text or picture
  37. True
  38. 208
  39. 246
  40. False

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