<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>文字滚动</title>
<style>
* {
margin: 0;
padding: 0;
}
.overflow {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
font-size: 14px;
height: 40px;
line-height: 40px;
color: red;
background: #333333;
}
.line {
font-size: 18px;
color: red;
white-space: nowrap;
animation: 10s move linear infinite normal;
}
@keyframes move {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-200%);
}
}
</style>
</head>
<body>
<div class="overflow">
<p class="line">随便写一点。。。随便写一点。。。随便写一点。。。随便写一点。。。随便写一点。。。。。</p>
</div>
</body>
</html>
注:使用时需要根据实际情况调整滚动距离。。。