← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. 74
  2. 260
  3. content
  4. a solid or dotted edge
  5. 160
  6. margin
  7. False
  8. 348
  9. True
  10. 98
  11. 144
  12. 284
  13. 122
  14. margin
  15. border
  16. 154
  17. False
  18. 252
  19. 218
  20. 76
  21. True
  22. 246
  23. 124
  24. space inside the border
  25. 152
  26. 260
  27. False
  28. False
  29. 210
  30. 220
  31. the text or picture
  32. the gap to other boxes
  33. True
  34. 136
  35. 254
  36. 286
  37. False
  38. 116
  39. 64
  40. 174

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