← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 112
  2. margin
  3. the gap round content
  4. True
  5. True
  6. space inside the border
  7. the text or picture
  8. 208
  9. space outside the border
  10. 230
  11. 252
  12. the gap to other boxes
  13. the line round the box
  14. 122
  15. 178
  16. True
  17. 94
  18. 272
  19. 324
  20. True
  21. 122
  22. content
  23. padding
  24. True
  25. border
  26. 274
  27. border
  28. padding
  29. 292
  30. False
  31. 322
  32. 138
  33. 274
  34. 172
  35. True
  36. False
  37. 318
  38. 266
  39. 170
  40. 248

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