← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the line round the box
  2. True
  3. True
  4. 206
  5. the text or picture
  6. 142
  7. 236
  8. 280
  9. False
  10. 140
  11. False
  12. 194
  13. 98
  14. 170
  15. the gap round content
  16. content
  17. True
  18. True
  19. border
  20. margin
  21. 244
  22. 232
  23. False
  24. 120
  25. 150
  26. 316
  27. 332
  28. 290
  29. padding
  30. 100
  31. 284
  32. 258
  33. a solid or dotted edge
  34. False
  35. 106
  36. False
  37. 112
  38. space inside the border
  39. False
  40. 296

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