Welcome to bytea
当前位置: Home 学习资料 网站制作 CSS实现图片半透明效果 今天是...date...

登录bbs

用户名
密码

bytea统计

Members : 43193
Content : 333
Web Links : 69
CSS实现图片半透明效果 PDF Print E-mail
Tuesday, 26 July 2005 02:36
先收集起来,今后做网页的时候可能会用到。关键是在Mozilla下的滤镜实现方法。


引用
前几天一位做网页设计的朋友问我这个问题:如何通过CSS来实现图片半透明效果,并且在IE和Mozilla上都可以得到支持。下面将我的方法分享给大家。

这个效果在IE和Mozilla浏览器上都可以工作,代码如下
代码
<img alt="powerbookg4.jpg" src="archives/images/powerbookg4.jpg" width="250" height="60" 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">


在IE 中需要通过"filter"来定义透明度"opacity",而在Mozilla中是可以直接解析"opacity",所以如果要使得这个效果在两种浏览 器中都得到支持,需要把两种设定都加进去。针对IE的设定:this.filters.alpha.opacity=50 而针对 Mozilla的设定:this.style.MozOpacity=0.5. 大家可以直接用这行代码给图片定义,只须修改图片地址就能实现上图效果。

Comments (0)Add Comment

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security code
Write the displayed characters


busy
 

支持本站:


相关文章


Connect with me via QQ:38074 or e-mail:

©2006 bytea.net All Copyrights Reserved.

本站备案编号:保密^_^

RSS:  

开启背景音乐