[ css 动画 animation ] animation新增动画属性的实例演示

<!DOCTYPE html>
<html lang='zh-cn'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>[ animation ] 新增动画属性的实例演示</title>
<meta http-equiv='description' content='this is my page'>
<meta http-equiv='keywords' content='keyword1,keyword2,keyword3'>

<style type='text/css'>
div {
  margin: 0; padding: 0;
}
#box {
  width: 100px; height: 100px; background:red;animation:move 3s 3 alternate forwards;position:absolute;left:0;top:0; 
}
@keyframes move{
  0%{
    left:0;
    top:0;
  }
  10%{
    left:300px;
    top:450px;
  }
  50%{
    left:0px;
    top:500px;
  }
  75%{
    left:900px;
     top:50px;
  }
  100%{
     left:70px;
     top:230px;
  }
}

</style>
</head>
<body>
  <div id='box'></div>
</body>
</html>

 

posted @ 2016-06-27 12:12  窗棂  Views(175)  Comments(0Edit  收藏  举报