
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
.list-box {
height: 30px;
display: flex;
line-height: 30px;
overflow: hidden;
}
.list-box .list {
width: 0;
margin-left: 20px;
flex: 1;
animation: scroll 10s ease 1s infinite;
}
.list-box * {
margin: 0;
padding: 0;
list-style-type: none;
}
@keyframes scroll {
0% {
transform: translateY(0);
}
20% {
transform: translateY(-100%);
}
40% {
transform: translateY(-200%);
}
60% {
transform: translateY(-300%);
}
80% {
transform: translateY(-400%);
}
100% {
transform: translateY(-480%);
}
}
</style>
</head>
<body>
<div class="list-box">
<h4 class="title">资讯:</h4>
<ul class="list">
<li>第一条信息</li>
<li>第二条信息</li>
<li>第三条信息</li>
<li>第四条信息</li>
<li>第五条信息</li>
</ul>
</div>
</body>
</html>