← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 82
  2. 310
  3. 228
  4. False
  5. 142
  6. False
  7. False
  8. the text or picture
  9. False
  10. 294
  11. 118
  12. padding
  13. 136
  14. border
  15. content
  16. False
  17. padding
  18. the gap to other boxes
  19. border
  20. 98
  21. margin
  22. True
  23. 168
  24. False
  25. 256
  26. 230
  27. 168
  28. 144
  29. 94
  30. 296
  31. 274
  32. False
  33. 104
  34. 70
  35. True
  36. space outside the border
  37. 222
  38. True
  39. 164
  40. 234

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