写一个 小锦鲤在游的html
<!DOCTYPE html>
<html>
<head>
<title>小锦鲤在游</title>
<style>
body {
background-color: #c6e2ff;
}
#fish {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100px;
height: 100px;
background-color: #ffcc99;
border-radius: 50%;
animation: swim 2s infinite;
}
#fish:before, #fish:after {
content: "";
position: absolute;
width: 20px;
height: 20px;
background-color: #ffcc99;
border-radius: 50%;
}
#fish:before {
top: 30%;
left: 40%;
}
#fish:after {
top: 30%;
left: 60%;
}
@keyframes swim {
0% {
transform: translate(-50%, -50%) rotate(0deg);
}
50% {
transform: translate(-50%, -50%) rotate(45deg);
}
100% {
transform: translate(-50%, -50%) rotate(0deg);
}
}
</style>
</head>
<body>
<div id="fish"></div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/0lF 著作权归作者所有。请勿转载和采集!