From W3C Wiki
< CSS‎ | Properties
Revision as of 22:41, 21 July 2011 by Plehegar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


The opacity property specifies the opacity of an element.


Values <alphavalue> | inherit
Initial value 1
Applies to All elements
Inherited No


  • <alphavalue>
    Syntactically a <number>. The uniform opacity setting to be applied across an entire object. Any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) will be clamped to this range.

  • inherit
    Takes the same specified value as the property for the element's parent.


Example A


 body {
   color: #fff;
   background-color: #666;
   background-color: red;
   opacity: 1.0;
   opacity: 0.4;


    <h1 id="op">CSS color property example(fully opaque)</h1>
    <h1 id="tr">CSS color property example(transparent)</h1>

Css3 colors opacity 001.png

CSS Reference

CSS Color defines the opacity property in 3.2. Transparency: the ‘opacity’ property.