码迷,mamicode.com
首页 > Web开发 > 详细

css动画栈学习_1

时间:2014-11-27 17:49:45      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   sp   on   div   log   bs   

下图通过css3动画栈实现了鼠标移上图片,图片发亮的效果。

具体代码如下:

<!DOCTYPE html>
<html >
<head>
<style> 
div
{
width:100px;
height:100px;
background:blue;

}
div:hover,img:hover{animation:shade 5s;
-webkit-animation:shade 5s;
-moz-animation:shade 5s;
-o-animation:shade 5s;
animation:shade 5s;
}
@keyframes shade{
from{opacity:1;}
15%{opacity:0.4;}
to{opacity:1;}
}
@-webkit-keyframes shade{
from{opacity:1;}
15%{opacity:0.4;}
to{opacity:1;}
}
@-moz-keyframes shade{
from{opacity:1;}
15%{opacity:0.4;}
to{opacity:1;}
}
@-o-keyframes shade{
from{opacity:1;}
15%{opacity:0.4;}
to{opacity:1;}
}
</style>
</head>
<body>

<div></div>

<p><img src="http://pica.nipic.com/2007-12-24/20071224112445514_2.jpg"/></p>

</body>
</html>

 

css动画栈学习_1

标签:style   blog   http   io   sp   on   div   log   bs   

原文地址:http://www.cnblogs.com/jiaojiaome/p/4126565.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!