<style>
.center {
margin: 100px auto;
top: 50%;
left: 50%;
width: 200px;
height: 200px;
background-color: pink;
}
.center:hover {
animation: doudong 0.1s linear infinite;
}
@keyframes doudong {
0% {
transform: translateX(5px);
transform: rotate(10deg);
}
100% {
transform: translateY(-5px);
transform: rotate(-10deg);
}
}
</style>
</head>
<body>
<div class="center">
</div>
</body>
CSS鼠标移动抖动 animation + transform
最新推荐文章于 2023-07-11 14:19:53 发布