← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the line round the box
  2. False
  3. border
  4. False
  5. False
  6. False
  7. the gap to other boxes
  8. True
  9. 182
  10. 232
  11. 258
  12. 220
  13. the text or picture
  14. 266
  15. border
  16. 202
  17. 140
  18. True
  19. margin
  20. True
  21. 274
  22. 112
  23. the gap round content
  24. 130
  25. 122
  26. 220
  27. 290
  28. 192
  29. 242
  30. 192
  31. 170
  32. 214
  33. 334
  34. 186
  35. margin
  36. False
  37. space inside the border
  38. 120
  39. 124
  40. 304

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