Setting Element Opacity

opacity property sets the transparency of an element.

The allowed range for opacity property is from 0 to 1. 0 means completely transparent. 1 means completely opaque.

            p { 
                padding: 5px; 
                border: medium double black; 
                background-color: lightgray; 
                font-family: sans-serif; 
            #myID { 
                font-size: x-large; 
                border: medium solid white; 
                background-color: green; 
                color: white; 
                opacity: 0.4; 
            a:hover { 
                color: red; 
            <span id="myID">CSS</span>
            This is a test.
            <a href=""></a> 
Click to view the demo
  HTML CSS Book 

Foreground Color Opacity:
  1. Setting the Foreground Color
  2. Setting Element Opacity