A. The value repeat-x repeats only horizontally, not vertically.
B. The property background-repeat is misspelled.
C. The URL must be in double quotes, not single quotes.
D. The background image will not show without background-size.
Solution
Step 1: Check the background-repeat value
repeat-x repeats the image only horizontally, not vertically.
Step 2: Match with the goal
The goal is to repeat both horizontally and vertically, so repeat should be used instead.
Final Answer:
The value repeat-x repeats only horizontally, not vertically. -> Option A
Quick Check:
repeat-x = horizontal only, not both [OK]
Hint: repeat-x repeats horizontally only, use repeat for both [OK]
Common Mistakes:
Using repeat-x when both directions are needed
Thinking single quotes break URL syntax
Assuming background-size is required for repeat
5. You want a background image to repeat only vertically but stop after 3 repeats. Which CSS approach can achieve this effect?
hard
A. Use background-repeat: no-repeat; and add 3 copies of the image manually.
B. Use background-repeat: repeat-y; and set the container height to 3 times the image height.
C. Use background-repeat: repeat; and limit repeats with background-size.
D. Use background-repeat: repeat-x; and set max repeats to 3.
Solution
Step 1: Understand CSS background-repeat limits
CSS does not have a direct property to limit the number of repeats.
Step 2: Use container size to control repeats
By setting background-repeat: repeat-y; and adjusting the container height to exactly 3 times the image height, the image will repeat vertically 3 times and then stop.
Final Answer:
Use background-repeat: repeat-y; and set the container height to 3 times the image height. -> Option B
Quick Check:
Control repeats by container size with repeat-y [OK]
Hint: Limit repeats by container size, not CSS property [OK]
Common Mistakes:
Expecting CSS to limit repeat count directly
Using repeat-x instead of repeat-y for vertical repeats