Easy Tutorial
❮ Jsref Replace Event Oncanplaythrough ❯

opacity Property

Style Object

Example

Make the DIV element semi-transparent:


Definition and Usage

The opacity property sets or returns the opacity of an element.

The opacity level describes the transparency level, where 1 is fully opaque, 0.5 is semi-transparent, and 0 is fully transparent.


Browser Support

All major browsers support the opacity property.

Note: IE8 and earlier versions support an alternative property, the filter property.


Syntax

Return the opacity property:

Set the opacity property:

Property Values

Value Description
number Specifies the opacity. From 0.0 (fully transparent) to 1.0 (fully opaque).
initial Sets this property to its default value. See initial
inherit Inherits this property from its parent element. See inherit

Technical Details

Default value: 1
Return value: String, representing the opacity property of the element.
CSS version CSS3

Related Articles

CSS Reference: opacity Property


Style Object

❮ Jsref Replace Event Oncanplaythrough ❯