← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. border
  2. the gap round content
  3. padding
  4. 142
  5. 260
  6. True
  7. True
  8. 192
  9. False
  10. 176
  11. content
  12. the text or picture
  13. margin
  14. 78
  15. False
  16. 100
  17. False
  18. 144
  19. 286
  20. 214
  21. 134
  22. 260
  23. 168
  24. 194
  25. margin
  26. False
  27. padding
  28. 200
  29. 64
  30. True
  31. 190
  32. the line round the box
  33. False
  34. 166
  35. 136
  36. 116
  37. 218
  38. 128
  39. True
  40. 330

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