CSS: Opacity (transparency)
Opacity property
The Opacity property is to specify degree of transparency for the whole element.
if you just want opacity in color, use
- CSS: rgb() color function
- CSS: HSL color
- color name
transparent
Syntax
Value is 0 to 1. The higher the opacity value, the more opaque.
div { /* Decimal number syntax */ opacity: 0.9; /* Percent syntax */ opacity: 90%; }
Example
increasingly higher opacity.
Alice was beginning to get very tired of sitting
Alice was beginning to get very tired of sitting
Alice was beginning to get very tired of sitting
Alice was beginning to get very tired of sitting
Alice was beginning to get very tired of sitting
Alice was beginning to get very tired of sitting
Browser Support
Supported in all browsers as of 2012-04-20.