← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. the text or picture
  3. 128
  4. 78
  5. True
  6. content
  7. 158
  8. a solid or dotted edge
  9. border
  10. False
  11. 144
  12. 318
  13. 362
  14. the gap round content
  15. False
  16. False
  17. 88
  18. 150
  19. margin
  20. 192
  21. 250
  22. 186
  23. 120
  24. the line round the box
  25. False
  26. 142
  27. 118
  28. 110
  29. padding
  30. 306
  31. 120
  32. margin
  33. True
  34. 266
  35. 142
  36. 216
  37. 212
  38. 102
  39. border
  40. 336

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