CSS Transparency for Images

25 Nov

Creating transparency with CSS is easy. Here is an example with images.

  • For IE we can set: this.filters.alpha.opacity=50
  • For Mozilla we set: this.style.MozOpacity=0.5

Example:

solar-radar (7K)
style=”-moz-opacity:0.5;filter:alpha(opacity=50);cursor:hand”
onmouseover=”this.style.MozOpacity=1;this.filters.alpha.opacity=100″
onmouseout=”this.style.MozOpacity=0.5;this.filters.alpha.opacity=50″>

Code:


<img
src="http://www.domedia.org/oveklykken/assets/misc/solar-radar.jpg"
width="105" height="140"
alt="solar-radar (7K)"
style="-moz-opacity:0.5;filter:alpha(opacity=50);cursor:hand"
onmouseover="this.style.MozOpacity=1;this.filters.alpha.opacity=100"
onmouseout="this.style.MozOpacity=0.5;this.filters.alpha.opacity=50"
>

No comments yet

Leave a Reply