Challenge - 5 Problems
Background Repeat Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ selector
intermediate2:00remaining
Which Tailwind class prevents background image repetition?
You want a background image to appear only once without repeating. Which Tailwind CSS class should you use?
Attempts:
2 left
💡 Hint
Think about the class that stops the image from repeating in any direction.
✗ Incorrect
The bg-no-repeat class stops the background image from repeating horizontally or vertically, so it appears only once.
❓ rendering
intermediate2:00remaining
What will you see with this Tailwind background repeat class?
Given this HTML snippet:
What is the visual result in the browser?
<div class="w-40 h-40 bg-[url('https://via.placeholder.com/40')] bg-repeat-x"></div>What is the visual result in the browser?
Tailwind
<div class="w-40 h-40 bg-[url('https://via.placeholder.com/40')] bg-repeat-x"></div>Attempts:
2 left
💡 Hint
The class name ends with '-x'.
✗ Incorrect
The bg-repeat-x class repeats the background image only along the horizontal axis (left to right), so you see multiple images side by side horizontally.
🧠 Conceptual
advanced2:00remaining
Why use
bg-repeat-y instead of bg-repeat-x?You want a background image to repeat vertically but not horizontally. Which Tailwind class achieves this, and why?
Attempts:
2 left
💡 Hint
Look carefully at the axis indicated by the class suffix.
✗ Incorrect
The bg-repeat-y class repeats the background image vertically (top to bottom) only. The -y suffix means vertical repetition.
📝 Syntax
advanced2:00remaining
Which Tailwind class is invalid for controlling background repeat?
Identify the invalid Tailwind CSS class from the options below that tries to control background repeat behavior.
Attempts:
2 left
💡 Hint
One class does not exist in Tailwind's background repeat utilities.
✗ Incorrect
bg-repeat-none is not a valid Tailwind class. The correct class to prevent repetition is bg-no-repeat.
❓ accessibility
expert2:00remaining
How to ensure background images with repeat do not reduce accessibility?
When using repeating background images with Tailwind CSS, what is the best practice to keep your site accessible for all users?
Attempts:
2 left
💡 Hint
Think about users who rely on screen readers or have vision impairments.
✗ Incorrect
Background images should be purely decorative and not contain important information. Ensure text has good contrast so everyone can read it easily.