Nearby lessons

57 of 61

Tailwind CSS - Opacity

Overview

Tailwind provides opacity utilities to control how transparent an element looks. You can apply opacity to text, backgrounds, borders, shadows, and entire elements.

Element Opacity

Use the opacity-{value} utilities to change the transparency of the whole element.

  • opacity-0 - Fully transparent
  • opacity-25 - 25% visible
  • opacity-50 - 50% visible
  • opacity-75 - 75% visible
  • opacity-100 - Fully visible

Opacity With Color Utilities

Tailwind also supports slash opacity syntax on many color utilities. For example, bg-blue-500/50 gives you a blue background at 50% opacity.

Similar syntax works for text, borders, rings, shadows, and outline colors.

🌀

tailwind Designer

Live Component Playground

html Source
Loading...
Built with Tailwind CSS • Instant Reflection

Common Use Cases

  • Disabled or inactive UI states
  • Overlay backdrops and modals
  • Subtle borders and dividers
  • Hover and focus transitions

Best Practice

Use opacity carefully so text remains readable and interactive controls stay accessible. For important text, avoid reducing opacity too much.

🧠 Test Your Knowledge

3 Questions

Progress: 0 / 3
Keep Going!Tailwind CSS - Tables