← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 294
  2. 276
  3. the line round the box
  4. 178
  5. space inside the border
  6. 212
  7. margin
  8. the text or picture
  9. 180
  10. False
  11. the gap round content
  12. False
  13. content
  14. margin
  15. False
  16. 102
  17. 162
  18. False
  19. True
  20. padding
  21. 166
  22. 150
  23. 262
  24. 218
  25. 278
  26. 218
  27. False
  28. the gap to other boxes
  29. 244
  30. 198
  31. 162
  32. 100
  33. False
  34. 350
  35. 254
  36. True
  37. 230
  38. 180
  39. space outside the border
  40. border

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