The opacity property controls how transparent an element is. The value is a number between 0 and 1, where 0 is fully transparent and 1 is fully opaque.
Opacity values range from 0 to 1. This allows smooth transitions, transparent layers, and visual effects.
| Value | Effect |
|---|---|
| 1 | Fully opaque |
| 0.5 | 50% transparency |
| 0 | Fully transparent |
In the following example, three boxes have different opacity values: 1, 0.5, and 0.
The first box is fully opaque, the second is semi-transparent, and the third is invisible.
Opacity is often used in hover effects. For example, an element may appear faint by default but become fully visible when hovered.
Opacity can be combined with many other CSS properties. Here are some suggestions:
✨ Ask Lara — your AI study partner
Unlock personalized learning support. Lara can explain lessons, summarize topics, and answer your study questions — available from the Go plan and above.
Lara helps you learn faster — exclusive to ReadyTools Go, Plus, and Max members.