html动画:元素沿着竖直方向偏移500px 动画无限次执行
<!DOCTYPE html>
<html>
<head>
<title>Vertical Animation</title>
<style>
#element{
position: relative;
top: 0;
animation: verticalAnim 1s ease-in-out infinite;
}
<pre><code> @keyframes verticalAnim {
0% { top: 0; }
50% { top: 500px; }
100% { top: 0; }
}
</style>
</code></pre>
</head>
<body>
<div id="element">
<p>Vertical Animation</p>
</div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/bR5L 著作权归作者所有。请勿转载和采集!