How is opacity specified in CSS3?

Opacity refers to the degree to which the content is transparent or opaque. We can use the property named opacity which takes the values ranging from 0 to 1. 0 specifies that the element is completely transparent where 1 means that the element is completely opaque. We can use the opacity property as follows:

div { 
    opacity: 0.6;
}

In the above example, an opacity of 60% is applied to the div section. The opacity property is not supported by the internet explorer browser. To make it work there, we need to use the filter property as polyfill as shown in the example below.

div { 
    opacity: 0.6;
    filter: alpha(opacity=60);
}

CSS Opacity Example