CSS3 opacity property
Set the transparency level of a div element:
{
opacity:0.5;
}
Try it out . . .
There are more examples at the bottom of this page.
Browser support
All major browsers support the opacity attribute.
Note: I E8 and earlier versions supported another filter property. Like: filter: Alpha (opacity -50)
Description of property definition and use
The Opacity property sets an element with a transparency level.
Default: | 1 |
---|---|
Inherited: | no |
Version: | CSS3 |
JavaScript syntax: | object .style.opacity=0.5 |
Grammar
value | describe |
---|---|
value | Specify opacity.From 0.0 (completely transparent) to 1.0 (completely opaque) |
inherit | The value of the Opacity property should inherit from the parent element |
More instances
Change the opacity of an element
This example demonstrates how JavaScript can be used to change the opacity of elements.