Colours follow the pattern {property}-{colour}-{shade}:
text-red-500,bg-emerald-100,border-indigo-600- Shades go from 50 (lightest) to 950 (darkest).
- Opacity:
bg-black/50
Text, background and border colours.
✍️ 3 exercises + code challenge in this lessonColours follow the pattern {property}-{colour}-{shade}:
text-red-500, bg-emerald-100, border-indigo-600bg-black/50Mastering Tailwind Colors helps you write clean and reliable Tailwind CSS code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.
<script src="https://cdn.tailwindcss.com"></script>
<div class="p-6 space-y-2">
<p class="text-red-500">text-red-500</p>
<p class="bg-emerald-100 text-emerald-800 p-2">bg-emerald-100</p>
<p class="border-2 border-indigo-600 p-2">border-indigo-600</p>
<p class="bg-black/50 text-white p-2">bg-black/50</p>
</div>
Check what you learned in “Tailwind Colors”.
Set a light green background.
<div class="">Saved</div>
Which shade is the darkest?
Make the paragraph text red-600 on a red-50 background.
Free sign-in required · Google login available
Stuck on something?
Ask the community in the CodesInTech forum.
Need a developer?
Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.
Explore Our Services