← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 212
  2. False
  3. 120
  4. True
  5. 264
  6. padding
  7. the line round the box
  8. the text or picture
  9. margin
  10. 220
  11. False
  12. 350
  13. False
  14. 272
  15. 212
  16. space outside the border
  17. 212
  18. border
  19. border
  20. 80
  21. 172
  22. 178
  23. 206
  24. the gap round content
  25. the gap to other boxes
  26. 102
  27. False
  28. True
  29. 328
  30. 238
  31. True
  32. 120
  33. 270
  34. 132
  35. margin
  36. False
  37. 112
  38. 232
  39. False
  40. a solid or dotted edge

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