← The box model lesson New set →

CSS Worksheet: Box Model

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

Answer key

  1. the text or picture
  2. content
  3. the gap round content
  4. 86
  5. False
  6. 102
  7. a solid or dotted edge
  8. 68
  9. False
  10. False
  11. 124
  12. 256
  13. 252
  14. 344
  15. 316
  16. space inside the border
  17. 258
  18. True
  19. margin
  20. 138
  21. 158
  22. True
  23. 124
  24. 216
  25. the gap to other boxes
  26. False
  27. 142
  28. 166
  29. 386
  30. 94
  31. 210
  32. 270
  33. 186
  34. 148
  35. 286
  36. False
  37. the line round the box
  38. space outside the border
  39. 290
  40. 190

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