简单的动画特效

在w3c上学习的css3

适用于火狐浏览器



<!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>
<style type="text/css">body{ background: #FFF0F5; padding-bottom: 20px; height: 100%;width:100% }
.zong{position:relative;}
.qiu{ width: 100px; height: 100px; background: #F5DEB3; -moz-animation:myfirst 7.5s; position:relative; margin-top: 20px; color: #FFFFFF;border-radius: 60px; position: absolute; }
.qiu2{ width: 100px; height: 100px; background: #F5DEB3; -moz-opacity:0.5; opacity:0.5;-moz-animation:mysecond 7.5s;  margin-top: 20px; color: #FFFFFF;border-radius: 60px; -moz-opacity:0.6;  float: left; position: absolute;}
p{ text-align: center; padding-top: 0px;  font-size: 30px;}

.qiu:hover{ -moz-transform: rotate(130deg);}
@-moz-keyframes myfirst
{
0%   {background:#F5DEB3; left:0px; top:0px;-moz-transform: rotate(30deg); }
10%   {background:#F5DEB3; left:20px; top:0px;-moz-transform: rotate(0deg); }
50%  {background:#D2B48C; left:800px; top:0px; -moz-transform: rotate(0deg);}
100% {background:#F5DEB3; left:0px; top:0px;-moz-transform: rotate(360deg); }
}
@-moz-keyframes mysecond
{
0%   {background:#F5DEB3; left:0px; top:0px;-moz-transform: rotate(30deg); }
10%   {background:#F5DEB3; left:20px; top:0px;-moz-transform: rotate(0deg); }
11%   {background:#F5DEB3; left:20px; top:0px;-moz-transform: rotate(30deg); }
50%  {background:#D2B48C; left:800px; top:0px; -moz-transform: rotate(0deg);}
51%  {background:#D2B48C; left:800px; top:0px; -moz-transform: rotate(30deg);}
100% {background:#F5DEB3; left:0px; top:0px;-moz-transform: rotate(360deg); }
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/main.css">
<title>首页</title>
</head>
<body>
<div  class="zong">
<div class="qiu2"><p>CSS3</p></div>
<div class="qiu"><P>CSS3</P> </div>

</div>
</body>
</html>



 

猜你喜欢

转载自1609053463.iteye.com/blog/2315622