Html & Html5

The World's best Software Development Study Portal

CSS Opacity

If we want to set any transparency for any element than we can use this opacity property of the CSS. Mostly it is used when we want to set any opacity or transparency for any image.
For Example:-

<!DOCTYPE html>





       opacity: 0.5;





<p> Before applying opacity property </p>

<img src="tajmahal.jpg" alt="normal Tajmahal" >

<p> After applying opacity property.</p>

<img class="transparency" src="tajmahal.jpg" alt="transparent Tajmahal">



Output of the program

Before applying opacity property.

normal rose

After applying opacity property.

transparent rose

So this is how we can set the transparency for an element.

CSS 3 training insitute | Best IT Training classes in Gurgaon | Web Designing Training Institute