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:
Please sign in to ask Lara about CSS opacity.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.