← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. space inside the border
  3. border
  4. False
  5. 218
  6. padding
  7. 128
  8. 202
  9. the line round the box
  10. 278
  11. 108
  12. True
  13. a solid or dotted edge
  14. 250
  15. True
  16. 194
  17. False
  18. False
  19. False
  20. 252
  21. 134
  22. 248
  23. True
  24. 212
  25. 234
  26. 402
  27. 138
  28. the gap round content
  29. space outside the border
  30. False
  31. content
  32. 312
  33. 88
  34. margin
  35. True
  36. False
  37. the text or picture
  38. 210
  39. True
  40. 228

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