Tailwind Colors

Text, background and border colours.

✍️ 3 exercises + code challenge in this lesson

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

Key Takeaways: Tailwind Colors

Mastering 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.

Tailwind Colors Code Example

Tailwind CSS
<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>
Free sign-in required · Google login available

Tailwind Colors Practice Exercises

Check what you learned in “Tailwind Colors”.

/ 3 solved
Fill in the blank

Set a light green background.

<div class="">Saved</div>
✓ Correct! Not quite. Try again.
Multiple choice

Which shade is the darkest?

✓ Correct! Not quite. Try again.
Code challenge

Make the paragraph text red-600 on a red-50 background.

Write the code in the live editor. Your answer is checked automatically.

Free sign-in required · Google login available

to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

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