Suppose we have a div with height 100px. We want the top to bottom scrolling of text when the text-overflow happened. Otherwise, nothing happens just show the full text. Here I am using the custom CSS for the animation. And the overflow detects by javascript code on document load. As most people suggest not use the marquee tag, I try to use something else.

 

HTML code for that:

CSS for animation: animation will start after 5 seconds for animation-delay: 5s;

Now detect the overflow if happened

 

You can check my codepen for demo.


Leave a Reply

Your email address will not be published. Required fields are marked *