Challenge - 5 Problems
Text Color Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate1:30remaining
Correct Tailwind class for red text
Which Tailwind CSS class will correctly apply a red text color to an element?
Attempts:
2 left
💡 Hint
Tailwind uses a specific pattern for text color classes starting with 'text-'.
✗ Incorrect
In Tailwind CSS, text colors use the pattern text-{color}-{shade}. For red, text-red-500 is a common shade.
❓ rendering
intermediate1:30remaining
Visual effect of
text-green-700What will be the visible effect on text when the class
text-green-700 is applied?Tailwind
<p class="text-green-700">Sample Text</p>Attempts:
2 left
💡 Hint
Tailwind color shades increase in darkness with higher numbers.
✗ Incorrect
The class text-green-700 applies a dark green color to the text. It does not affect font weight or background.
❓ selector
advanced2:00remaining
Selecting text color for accessibility
Which Tailwind text color utility is best for ensuring good contrast on a white background for accessibility?
Attempts:
2 left
💡 Hint
Higher contrast means darker text on light backgrounds.
✗ Incorrect
text-gray-900 is a very dark gray, providing strong contrast on white backgrounds, which is important for readability and accessibility.
❓ layout
advanced2:00remaining
Combining text color with responsive design
Which Tailwind classes will make text blue on small screens and red on medium and larger screens?
Attempts:
2 left
💡 Hint
Tailwind uses prefixes like md: to apply styles at certain screen sizes.
✗ Incorrect
text-blue-500 applies blue text by default (small screens). md:text-red-500 changes text to red starting at medium screens and up.
❓ accessibility
expert2:30remaining
Ensuring text color meets WCAG contrast standards
Given a background color of
bg-yellow-300, which text color utility ensures the best WCAG AA contrast compliance?Tailwind
<div class="bg-yellow-300 p-4"> <p class="?">Accessible Text</p> </div>
Attempts:
2 left
💡 Hint
WCAG AA requires sufficient contrast between text and background colors.
✗ Incorrect
text-black provides the highest contrast on a light yellow background, meeting WCAG AA standards for readability.