CSS opacity Property Reference
The CSS opacity property is a standard property in CSS Color. Review its formal syntax, computed behavior, and practical declarations.
Updated 2026-08-12
opacity overview
The CSS opacity property is a standard property in CSS Color. Review its formal syntax, computed behavior, and practical declarations.
The property is not inherited by default. Use an explicit global keyword when inheritance is intended.
Syntax and formal definition
| Field | Value |
|---|---|
| Formal syntax | <opacity-value> |
| Initial value | 1 |
| Applies to | allElements |
| Inherited | No |
| Percentages | mapToRange0To1 |
| Computed value | specifiedValueNumberClipped0To1 |
| Animation type | byComputedValueType |
| Media | visual |
| Specification group | CSS Color |
| Status | Standard |
Practical examples
These declarations demonstrate valid ways to set opacity. The initial and inherit global keywords remain available even when a property-specific value is preferable.
CSS
.reset-example {
opacity: initial;
}
.inherit-example {
opacity: inherit;
}
@supports (opacity: 0.5) {
.supported {
opacity: 0.5;
}
}