0
0
Tailwindmarkup~20 mins

Text color utilities in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Text Color Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
1:30remaining
Correct Tailwind class for red text
Which Tailwind CSS class will correctly apply a red text color to an element?
Acolor-red
Btext-red-500
Ctextcolor-red
Dred-text
Attempts:
2 left
💡 Hint
Tailwind uses a specific pattern for text color classes starting with 'text-'.
rendering
intermediate
1:30remaining
Visual effect of text-green-700
What will be the visible effect on text when the class text-green-700 is applied?
Tailwind
<p class="text-green-700">Sample Text</p>
AThe text color changes to a dark green shade.
BThe text becomes bold and green.
CThe background color changes to green.
DThe text color changes to light green.
Attempts:
2 left
💡 Hint
Tailwind color shades increase in darkness with higher numbers.
selector
advanced
2:00remaining
Selecting text color for accessibility
Which Tailwind text color utility is best for ensuring good contrast on a white background for accessibility?
Atext-gray-900
Btext-gray-300
Ctext-yellow-200
Dtext-pink-100
Attempts:
2 left
💡 Hint
Higher contrast means darker text on light backgrounds.
layout
advanced
2:00remaining
Combining text color with responsive design
Which Tailwind classes will make text blue on small screens and red on medium and larger screens?
Amd:text-blue-500 text-red-500
Btext-red-500 sm:text-blue-500
Ctext-blue-500 lg:text-red-500
Dtext-blue-500 md:text-red-500
Attempts:
2 left
💡 Hint
Tailwind uses prefixes like md: to apply styles at certain screen sizes.
accessibility
expert
2: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>
Atext-yellow-100
Btext-yellow-500
Ctext-black
Dtext-white
Attempts:
2 left
💡 Hint
WCAG AA requires sufficient contrast between text and background colors.