编写html代码一个从左向右滚动的圆圈同时有一行文字围绕着这个圆圈的轨迹旋转
<!DOCTYPE html>
<html>
<head>
<title>Scrolling Circle</title>
<style>
.container {
position: relative;
height: 200px;
overflow: hidden;
}
.circle {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: red;
animation: scroll 5s linear infinite;
}
.text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
font-size: 24px;
animation: rotate 5s linear infinite;
}
@keyframes scroll {
from {left: -50px;}
to {left: 100%;}
}
@keyframes rotate {
from {transform: translate(-50%, -50%) rotate(0deg);}
to {transform: translate(-50%, -50%) rotate(360deg);}
}
</style>
</head>
<body>
<div class="container">
<div class="circle"></div>
<div class="text">Hello, World!</div>
</div>
</body>
</html
原文地址: https://www.cveoy.top/t/topic/fk3L 著作权归作者所有。请勿转载和采集!