← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. space outside the border
  2. content
  3. 166
  4. 282
  5. 136
  6. the text or picture
  7. 144
  8. 290
  9. 348
  10. False
  11. 320
  12. True
  13. 202
  14. border
  15. True
  16. True
  17. False
  18. 176
  19. the gap round content
  20. space inside the border
  21. False
  22. False
  23. True
  24. False
  25. 96
  26. margin
  27. False
  28. 196
  29. False
  30. 318
  31. 286
  32. False
  33. 182
  34. 146
  35. 374
  36. a solid or dotted edge
  37. False
  38. 378
  39. border
  40. 332

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