首页 > Web开发 > 详细

CSS鼠标悬停图片上图片变灰 变色 半透明

时间:2015-07-02 15:30:32      阅读:297      评论:0      收藏:0      [点我收藏+]

<!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=utf-8" />
<title>无标题文档</title>
<style>
.div1,.div2{ width:500px; margin:20px auto}
.div1 a:hover img{filter:alpha(Opacity=80);-moz-opacity:0.8;opacity: 0.8}
.div2 a:hover img{filter:alpha(Opacity=70);-moz-opacity:0.7;opacity: 0.7}
</style>
</head>

<body>
<p>鼠标移动到图片悬停时,图片变色滤镜效果:</p>
<div class="div1"><a href="#"><img src="images/div-a-bg.png" /></a></div>
<div class="div2"><a href="#"><img src="images/an.gif" /></a></div>
</body>
</html>

CSS鼠标悬停图片上图片变灰 变色 半透明

原文:http://www.cnblogs.com/robt/p/4616133.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!