html之html5 支持 marquee> 吗
JeffreyZhao
阅读:60
2025-05-04 20:05:19
评论:0
Html 5 是否支持 marquee 元素?如果没有,我们如何通过 Css 3 编码来实现这种效果(设计)。我的意思是将文本从一侧滚动到另一侧,等等。 一些浏览器仍然支持跑马灯元素。但是当我用谷歌搜索它时。有些网站说 html 5 不支持它。那么它在 css 3 中的替代选项是什么。
请您参考如下方法:
你可以使用css关键帧制作跑马灯效果
<div class="marquee">
<div>
<span>This is marquee text...done with css keyframes without using marquee tag</span>
<span>This is marquee text...done with css keyframes without using marquee tag</span>
</div>
body { margin: 20px; }
.marquee {
height: 25px;
width: 600px;
overflow: hidden;
position: relative;
}
.marquee div {
display: block;
width: 200%;
height: 30px;
position: absolute;
overflow: hidden;
animation: marquee 5s linear infinite;
}
.marquee span {
float: left;
width: 50%;
}
@keyframes marquee {
0% { left: 0; }
100% { left: -100%; }
}
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。



