Home > Web Front-end > HTML Tutorial > 如何利用CSS实现图片的透明效果_html/css_WEB-ITnose

如何利用CSS实现图片的透明效果_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:36:24
Original
925 people have browsed it

如何利用CSS实现图片的透明效果:
建议:尽可能的手写代码,可以有效的提高学习效率和深度。
在网页的实际应用中,往往需要设置图片的透明度,下面就简单介绍一下如何实现此效果。
代码实例如下:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">.first image{  filter:alpha(opacity=50);  -moz-opacity:0.5;  opacity:0.5;}</style></head><body><div class="first"><img src="mytest/demo/bordera.jpg" alt="战斗机"/></div><div class="second"><img src="mytest/demo/bordera.jpg" alt="战斗机"/></div></body></html>
Copy after login

以上代码实现图片的透明度效果,大家也可以参阅CSS如何设置div背景透明度且兼容性良好一章节了解更多相关透明度的内容

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template