← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 250
  2. False
  3. 184
  4. 142
  5. False
  6. padding
  7. padding
  8. 126
  9. 172
  10. 194
  11. margin
  12. False
  13. space inside the border
  14. 146
  15. False
  16. False
  17. space outside the border
  18. 214
  19. 168
  20. 192
  21. True
  22. True
  23. False
  24. margin
  25. True
  26. 158
  27. 244
  28. 98
  29. 306
  30. 138
  31. 150
  32. 260
  33. 102
  34. the gap round content
  35. content
  36. 202
  37. the gap to other boxes
  38. 176
  39. 202
  40. True

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