← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 184
  2. 172
  3. False
  4. False
  5. 158
  6. space inside the border
  7. 282
  8. False
  9. True
  10. 154
  11. 146
  12. 92
  13. True
  14. a solid or dotted edge
  15. True
  16. 108
  17. False
  18. the line round the box
  19. 116
  20. content
  21. 130
  22. False
  23. 160
  24. 138
  25. space outside the border
  26. 130
  27. 110
  28. 114
  29. 150
  30. 284
  31. 162
  32. False
  33. 110
  34. 176
  35. the text or picture
  36. 238
  37. 334
  38. padding
  39. the gap round content
  40. True

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