← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. padding
  2. padding
  3. border
  4. True
  5. the line round the box
  6. 182
  7. the gap round content
  8. 316
  9. 272
  10. 172
  11. 98
  12. 224
  13. False
  14. False
  15. 180
  16. content
  17. 254
  18. space inside the border
  19. 324
  20. 94
  21. False
  22. 172
  23. the gap to other boxes
  24. margin
  25. 80
  26. the text or picture
  27. 260
  28. 112
  29. border
  30. 310
  31. 358
  32. True
  33. False
  34. 248
  35. space outside the border
  36. 204
  37. False
  38. 190
  39. False
  40. True

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