用css filter做鼠标滑过图片效果

2022-04-15 0 385

首先看个简单的例子吧。

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ /> <title>http://www.cssrain.cn</title> <style> *{ margin:0; padding:0;} body{ margin:0 auto; font-size:12px;} .model{margin:0 auto; width:30px;} .model a:hover{ text-decoration:none;} .model a img{ border:#fff 1px solid;} .model a:hover img{ border:#888 1px dotted;} .model a span{ padding:0; display:block; width:80px; height:50px; margin-top:-32px; overflow:hidden; line-height:14px; filter: Alpha(opacity=0); opacity:.0; cursor:pointer; text-align:center;} </style> </head> <body> <div class=”model”><a href=”#”><img src=”http://www.cssrain.cn/demo/demo111111.jpg” border=”0″ /></a></div> <div class=”model”><a href=”#”><img src=”http://www.cssrain.cn/demo/demo222222.jpg” border=”0″ /></a></div> </body> </html>

[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]

免责声明:
1、本网站所有发布的源码、软件和资料均为收集各大资源网站整理而来;仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。 不得使用于非法商业用途,不得违反国家法律。否则后果自负!

2、本站信息来自网络,版权争议与本站无关。一切关于该资源商业行为与www.niceym.com无关。
如果您喜欢该程序,请支持正版源码、软件,购买注册,得到更好的正版服务。
如有侵犯你版权的,请邮件与我们联系处理(邮箱:skknet@qq.com),本站将立即改正。

NICE源码网 CSS/HTML 用css filter做鼠标滑过图片效果 https://www.niceym.com/16976.html