第五章 Css动画

2018-07-07  本文已影响2人  时修七年

Css动画:

transition过渡

demo

animation

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>

  <style type="text/css">
    .box {
        width: 100px;
        height: 100px;
        background: red;
        position: relative;
        -webkit-animation-name: first;
        -webkit-animation-duration: 3s;
        -webkit-animation-timing-function: linear;
    }

    @-webkit-keyframes first {
        0% {top: 0;left: 0;background: red;}
        25% {top: 0; left: 200px;background: green;}
        50% {top: 100px; left: 200px; background: orange;}
    }
  </style>
</head>
<body>
<div class="box">
    
</div>
</body>
</html>

上一篇 下一篇

猜你喜欢

热点阅读