← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 332
  2. padding
  3. 300
  4. padding
  5. 248
  6. the line round the box
  7. a solid or dotted edge
  8. border
  9. True
  10. True
  11. the gap to other boxes
  12. 212
  13. True
  14. 132
  15. False
  16. True
  17. margin
  18. space outside the border
  19. 278
  20. 278
  21. False
  22. border
  23. 112
  24. space inside the border
  25. 192
  26. 218
  27. 262
  28. 338
  29. 306
  30. 244
  31. 172
  32. False
  33. 76
  34. 266
  35. False
  36. 144
  37. the text or picture
  38. 112
  39. 264
  40. 234

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