2-16编程联系
来源:3-1 @keyframes
a386491333
2017-06-22 21:08:21
<html>
<head>
<meta charset="UTF-8">
<title>2-9</title>
<style type="text/css">
div {
font-family: Arial;
font-size: 72px;
font-weight: bold;
position: fixed;
right: 0;
left: 0;
width: 30px;
height: 30px;
margin: auto;
transform: rotate(90deg);
/*此处写代码*/
top:90%;
animation: active1 .8s infinite alternate; }
@keyframes active1{
form {top:90%;}
to {top:95%;}
} </style>
</head>
<body>
<div>></div>
</body>
</html>
做不出像gif中可以弹2次的动画,只能做出1次的效果
1回答
定义动画时,不止可以使用from to的,还可以使用百分比多设置几个时间轴,在一个动画中完成抖动效果。例如:
相似问题