Thursday 7 July 2011

CSS Image Opacity / Transparency

The CSS3 syntax for transparency is opacity:x

where x can be a value from 0.0 - 1.0. A lower value makes the element more transparent.

Image Transparency - Mouseover Effect



<img src="yourimage.jpg" style="opacity:0.4;"
onmouseover="this.style.opacity=1;"
onmouseout="this.style.opacity=0.4;" />

Click here to see the W3Schools.com example

No comments:

Post a Comment