← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 146
  3. space inside the border
  4. padding
  5. 162
  6. a solid or dotted edge
  7. 178
  8. the gap to other boxes
  9. 256
  10. 296
  11. 108
  12. 166
  13. 236
  14. True
  15. 238
  16. 242
  17. False
  18. the text or picture
  19. the gap round content
  20. margin
  21. 98
  22. 230
  23. 160
  24. 260
  25. border
  26. padding
  27. 354
  28. 182
  29. 146
  30. False
  31. 110
  32. 222
  33. False
  34. border
  35. 150
  36. True
  37. margin
  38. False
  39. False
  40. 150

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