Css动画:
- 1.视觉暂留作用
- 2.画面逐渐变化
动画能够带来愉悦感,引起注意,掩饰延时请求
transition过渡
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>
网友评论