opacity

Summary

The opacity CSS property specifies the transparency of an element, that is, the degree to which the background behind the element is overlaid.

The value applies to the element as a whole, including its contents, even though the value is not inherited by child elements. Thus, an element and its contained children all have the same opacity relative to the element's background, even if the element and its children have different opacities relative to one another.

Syntax

Values

<number>

Is a <number> in the range 0.0 to 1.0, both included, representing the opacity of the channel, that is the value of its alpha channel. Any value outside the interval, though valid, is clamped to the nearest limit in the range.

[1] Prior to Gecko 1.7 (Firefox 0.9) the -moz-opacity property was implemented in a non-standard (inherited) way. With Firefox 0.9 the behavior changed and the property was renamed to opacity. Since then -moz-opacity was supported just as an alias for opacity.

Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) and later do not support -moz-opacity and support for MozOpacity in javascript was removed in Gecko 13 (Firefox 13 / Thunderbird 13 / SeaMonkey 2.10). By now, you should be using simply opacity.

[2] Prior to version 9, Internet Explorer does not support opacity, rather it supports a filter property instead with alpha(opacity=xx) or "alpha(opacity=xx)" as value (both are synonymous). IE4 to IE9 supported the extended form progid:DXImageTransform.Microsoft.Alpha(Opacity=xx). IE8 introduced -ms-filter, which is synonymous with filter. Both are gone in IE10.

[3] Similar to -moz-opacity, -khtml-opacity has been dead since early 2004 (release of Safari 1.2).
Konqueror never had support for -khtml-opacity and had been supporting opacity since version 4.0.