← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 144
  2. the text or picture
  3. margin
  4. 156
  5. 238
  6. space inside the border
  7. content
  8. True
  9. a solid or dotted edge
  10. 232
  11. the line round the box
  12. the gap round content
  13. 148
  14. True
  15. 142
  16. False
  17. 130
  18. 254
  19. 176
  20. 274
  21. 294
  22. 196
  23. 142
  24. 160
  25. space outside the border
  26. False
  27. 194
  28. 360
  29. the gap to other boxes
  30. padding
  31. True
  32. 116
  33. False
  34. 118
  35. 232
  36. 182
  37. margin
  38. 154
  39. 70
  40. 202

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