CSS - Opacity




CSS Opacity

CSS Opacity property is used to make elements opaque, transparent, translucent by giving the value between 0.0 to 1.0.A lower value makes the element more transparent.The CSS opacity property is a part of the CSS3.

E9, Firefox, Chrome, Opera, and Safari use the property opacity for transparency.IE8 and earlier use filter:alpha(opacity=x). The x can take a value from 0 - 100. A lower value makes the element more transparent.

Example

<!DOCTYPE html>
<html>
<head>
<style> 
div {
    background-color: #ffa500;
    opacity: 0.6;
    filter: Alpha(opacity=50); /* IE8 and earlier */
}
</style>
</head>
<body>
<h1>The opacity Property</h1>
<p>The following div element's opacity is 0.6. Note that both the text and the background-color are affected by the opacity level:</p>
<div>CSS Opacity property is used to make elements opaque, transparent, translucent by giving the value between 0.0 to 1.0.A lower value makes the element more transparent.The CSS opacity property is a part of the CSS3.</div>
</body>
</html>

Result