← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 246
  2. 214
  3. the text or picture
  4. 396
  5. False
  6. a solid or dotted edge
  7. True
  8. False
  9. False
  10. 318
  11. False
  12. False
  13. 144
  14. padding
  15. space inside the border
  16. the gap round content
  17. 266
  18. the gap to other boxes
  19. the line round the box
  20. 324
  21. 310
  22. 72
  23. True
  24. margin
  25. 260
  26. 134
  27. 130
  28. 108
  29. space outside the border
  30. 300
  31. 96
  32. 256
  33. border
  34. 160
  35. 152
  36. 128
  37. 212
  38. 152
  39. 142
  40. 300

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