← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap to other boxes
  2. content
  3. 222
  4. 116
  5. 344
  6. space inside the border
  7. 278
  8. 202
  9. False
  10. space outside the border
  11. 120
  12. 278
  13. True
  14. a solid or dotted edge
  15. border
  16. 300
  17. False
  18. 224
  19. margin
  20. border
  21. 268
  22. 366
  23. 174
  24. 344
  25. False
  26. 232
  27. padding
  28. True
  29. 218
  30. 154
  31. 196
  32. 128
  33. the line round the box
  34. False
  35. False
  36. 108
  37. 166
  38. 84
  39. the gap round content
  40. the text or picture

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