← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. True
  2. border
  3. 258
  4. 146
  5. 208
  6. margin
  7. False
  8. 68
  9. a solid or dotted edge
  10. 168
  11. 232
  12. padding
  13. False
  14. 98
  15. 162
  16. 338
  17. content
  18. 186
  19. 278
  20. 116
  21. 184
  22. padding
  23. border
  24. 172
  25. False
  26. False
  27. 244
  28. False
  29. False
  30. 276
  31. space inside the border
  32. True
  33. True
  34. 214
  35. the text or picture
  36. 170
  37. the gap to other boxes
  38. 142
  39. 238
  40. 298

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