opacity

Description »

This sets the overall transparency of an element.

Browser Compatibility
IE FF GC S O

Possible Values »

  • opacity: value;
  • The value can be any number ranging from 0.0 (fully transparent) to 1.0 (fully opaque)
  • opacity: inherit;
  • Inherits opacity value from the parent element

Details »

The opacity property sets the transparency of an element. If you want an element to be fully transparent, meaning it cannot be seen, then set the value to 0.0. If you want the element to be fully opaque, which is default, then set it to 1.0.

Any number in between, like 0.5, will produce a result somewhere between invisible and opaque. You would see the element but also get a glimpse of what is behind it.

Note that older versions of Internet Explorer do not support this property. You must define this instead:

  • filter:Alpha(opacity=value);

where the value is a percentage from 0 to 100.

In Practice »

Results CSS
Try it! at The CSS Zone Sandbox
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License