> All in One 586: CSS-Only Marquee Effect

Ads

Sunday, April 5, 2020

CSS-Only Marquee Effect

You make sure the text is more than twice the width of the screen, then use negative translate animations to do the marquee movement.

You’ll probably want to aria-hidden all but one of them if you need to duplicate the text. Or, you could use a very clever CSS trick to “duplicate” the text using text-shadow.

Nice to see prefers-reduced-motion in there stopping the effect when it should be.

Direct Link to ArticlePermalink

The post CSS-Only Marquee Effect appeared first on CSS-Tricks.



from CSS-Tricks https://ift.tt/2UyaSZv
via IFTTT

No comments:

Post a Comment

How to Wait for the sibling-count() and sibling-index() Functions

New features don’t just pop up in CSS (but I wish they did). Rather, they go through an extensive process of discussions and considerations,...