← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. False
  3. 134
  4. border
  5. margin
  6. False
  7. the line round the box
  8. 318
  9. 204
  10. 150
  11. 282
  12. space inside the border
  13. True
  14. 84
  15. False
  16. 246
  17. the gap to other boxes
  18. content
  19. 248
  20. 230
  21. padding
  22. the gap round content
  23. 376
  24. 78
  25. False
  26. 148
  27. 182
  28. False
  29. 94
  30. 124
  31. 284
  32. 162
  33. 102
  34. True
  35. the text or picture
  36. 266
  37. False
  38. 152
  39. 296
  40. 122

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