上图
上代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div class="w">
<div class="box">
日进斗金的大广告日进斗金的大广告
日进斗金的大广告
日进斗金的大广告
</div>
</div>
<style>
.w{
width: 800px;
height: 100px;
background-color: black;
margin: 100px auto;
overflow: hidden;
}
.box{
height: 100px;
position:relative;
color: red;
right: 525px;
line-height: 100px;
animation: box 15s linear
}
@keyframes box {
from {right: -800px;}
to {right: 525px;}
}
</style>
</body>
</html>
复制粘贴就能用
核心代码
animation: box 15s linear
@keyframes box {
from {right: -800px;}
to {right: 525px;}
}
这里的box是class名,要是要修改或者加的话注意就行
希望有帮助到你