← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the gap to other boxes
  2. True
  3. 160
  4. False
  5. 108
  6. 108
  7. margin
  8. 172
  9. content
  10. the line round the box
  11. 274
  12. 376
  13. 328
  14. the text or picture
  15. False
  16. False
  17. 224
  18. space outside the border
  19. 312
  20. 146
  21. False
  22. 186
  23. border
  24. 246
  25. 216
  26. padding
  27. 296
  28. a solid or dotted edge
  29. 128
  30. 286
  31. 174
  32. 108
  33. False
  34. 276
  35. 138
  36. 186
  37. 188
  38. 272
  39. True
  40. True

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