In HTML 4, there is this <marquee>
tag that shows sliding text across the screen.
What is its equivalent in HTML5?
Use CSS animation instead of <marquee> CSS animation enables you to create the marquee effect and make it user-friendly by using the prefers-reduced-motion media query to stop all animations for those who don't want them.
The <marquee> tag has been deprecated in HTML5 and should no longer be used. It is recommended that you use CSS instead to create a similar scrolling effect. This tag is also commonly referred to as the <marquee> element.
The <marquee> tag in HTML is used to create scrolling text or image in a webpages. It scrolls either from horizontally left to right or right to left, or vertically top to bottom or bottom to top.
The <marquee> element was used to identify text that should move across a defined section of a webpage in a horizontal or vertical direction. The element has been deprecated and should no longer be used. CSS or JavaScript can be used to create similar effects.
By css animation you can do the same thing
.holder {
background:#ccc;
padding:0.5rem;
overflow: hidden;
}
.news {
animation : slide 10s linear infinite;
}
@keyframes slide {
0% {
transform: translatex(0%)
}
100% {
transform: translatex(100%)
}
}
<div class="holder">
<div class="news">Hello....</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With