← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 150
  2. space outside the border
  3. the text or picture
  4. 170
  5. True
  6. 290
  7. 306
  8. 144
  9. False
  10. 272
  11. False
  12. 278
  13. the gap to other boxes
  14. False
  15. True
  16. 220
  17. 156
  18. the line round the box
  19. True
  20. False
  21. 136
  22. 126
  23. 220
  24. border
  25. False
  26. 280
  27. 192
  28. a solid or dotted edge
  29. 158
  30. padding
  31. margin
  32. content
  33. 206
  34. False
  35. 376
  36. 112
  37. 304
  38. False
  39. 238
  40. 302

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