大佬教程收集整理的这篇文章主要介绍了CSS 文本滚动,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
.cssmarquee {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.cssmarquee .wrapper {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
animation: cssmarqueeWrapper 3s linear infinite;
}
.cssmarquee .marqueeWords {
position: absolute;
height: 100%;
left: 0;
top: 0;
font-weight: bold;
color: #fff;
margin: 0;
text-align: left;
white-space: nowrap; /* no wrap */
transform: translateX(0);
display: flex;
align-items: center;
animation: cssmarquee 3s linear infinite;
}
@keyframes cssmarqueeWrapper {
0% {
transform: translateX(100%); /* parent 100% */
}
100% {
transform: translateX(0);
}
}
@keyframes cssmarquee {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-100%); /* words -100% */
}
}
<div class="cssmarquee">
<div class="wrapper">
<p class="marqueeWords">滚动提示</p>
</div>
</div>
© 著作权归作者所有
以上是大佬教程为你收集整理的CSS 文本滚动全部内容,希望文章能够帮你解决CSS 文本滚动所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。