- 时间:2021-06-21 17:12 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:兼容多浏览器实现半透明(Opera ie firefox)
Click on a link above to make the image disappear and re-appear by gradually fading in/out. It uses CSS transparency, in CSS you can set the transparency in different ways. To ensure that it works on most browsers we use all three.
[b]opacity: 0.5;[/b]
This one is the official CSS3 method, at the moment it works in newer Mozilla versions.
[b]-moz-opacity: 0.5;
[/b]This one works in older versions of Mozilla and Phoenix/FireBird/FireFox.
-khtml-opacity: 0.5;
This is used by browsers that use teh KHTML rendering engine, namely Konquerer on Linux and Safari on MacOS.
[b]filter: alpha(opacity=50);[/b]
This one works only in MSIE.
There is actually another one: -khtml-opacity: 0.5; works for the browsers Konquerer on Linux and Safari on MacOS. You could add it too if you want to support these users. Somewhere in the near future most browsers will support CSS3 and opacity: 0.5; should work everywhere.
[url=http://www.brainerror.net/scripts_js_blendtrans.php]http://www.brainerror.net/scripts_js_blendtrans.php[/url]
[url=http://realazy.org/blog/2006/03/21/ie-firefox-opera-alpha-transparency/]http://realazy.org/blog/2006/03/21/ie-firefox-opera-alpha-transparency/[/url]
[url=http://alistapart.com/stories/pngopacity/]http://alistapart.com/stories/pngopacity/[/url]