Friday, June 25, 2010

How to add shade effect to an Image using CSS?

Using "Opacity" attribute we can add a Shade / Transparency effect to an Image.Please go through the below example for more information.

Without Shade.


   1:  <img src="../Image/ferrari.jpg" alt=""/>






With Shade.


   1:  //This style attribute work for IE+Firefox.

   2:  <img style="opacity:0.4;" src="../Images/ferrari.jpg alt=""/>

   3:  //Or use this to make it work across all the browsers.

   4:  <img style="opacity:0.4;filter:alpha(opacity=40);" src="../Images/ferrari.jpg alt=""/>



*Please leave a comment before you leave.

No comments:

Post a Comment