← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. False
  2. the text or picture
  3. 170
  4. False
  5. 186
  6. 210
  7. margin
  8. 162
  9. False
  10. 272
  11. 308
  12. True
  13. 212
  14. 142
  15. 254
  16. True
  17. the line round the box
  18. border
  19. 254
  20. 184
  21. space outside the border
  22. 90
  23. 294
  24. 328
  25. padding
  26. True
  27. 164
  28. False
  29. the gap round content
  30. True
  31. 212
  32. 144
  33. False
  34. 192
  35. 130
  36. 334
  37. 172
  38. 262
  39. 166
  40. 144

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