CSS:opacity
From MDC
« CSS « CSS Reference
[edit] Summary
opacity specifies the transparency of an element, i.e. how well you can see through an element.
- Initial value: 1 (opaque)
- Applies to: all elements
- Inherited: no
- Percentages: n/a
- Media:
visual - Computed value:
This is a CSS 3 property, and it is new starting with Mozilla 1.7; prior to Mozilla 1.7 the -moz-opacity property could be used for a similar effect (-moz-opacity was implemented as an inherited property). The -moz-opacity property name is now an alias for opacity, and while it will continue to exist as an alias, the old name is deprecated.
[edit] Syntax
opacity: <number> | inherit ;
[edit] Values
- 0 (or less)
- The element is fully transparent (invisible)
- 0 < number < 1
- The element is translucent (background can be seen)
- 1 (or more)
- The element is fully opaque (solid)
[edit] Examples
hbox.example {
opacity: 0.5; /* see the background through the hbox */
}
[edit] Notes
[edit] Specifications
[edit] Browser compatibility
| Browser | Lowest Version |
|---|---|
| Internet Explorer | 0 |
| Firefox | 0.9 |
| Netscape | ? |
| Opera | ? |
| Safari | ? |