← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 174
  2. 132
  3. 312
  4. content
  5. 174
  6. space inside the border
  7. 246
  8. 332
  9. the text or picture
  10. border
  11. 218
  12. False
  13. 82
  14. 242
  15. True
  16. 82
  17. 150
  18. 156
  19. 114
  20. False
  21. 140
  22. the line round the box
  23. 104
  24. True
  25. 182
  26. the gap round content
  27. a solid or dotted edge
  28. 246
  29. 304
  30. margin
  31. 256
  32. False
  33. True
  34. padding
  35. False
  36. 126
  37. False
  38. True
  39. 380
  40. 98

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