← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. 148
  3. the gap to other boxes
  4. 76
  5. 188
  6. content
  7. 110
  8. 150
  9. space outside the border
  10. 202
  11. True
  12. False
  13. True
  14. 124
  15. 272
  16. margin
  17. 114
  18. 328
  19. 264
  20. 144
  21. a solid or dotted edge
  22. the text or picture
  23. True
  24. padding
  25. 134
  26. False
  27. 296
  28. space inside the border
  29. 292
  30. 140
  31. False
  32. the line round the box
  33. False
  34. False
  35. True
  36. False
  37. padding
  38. 222
  39. 130
  40. the gap round content

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