Text with a moving background?
No JavaScript needed.
This effect is pure CSS, and it’s clean, fast, and surprisingly easy to pull off.
We use:
- background-image 👉 display the image
- background-clip: text 👉 attach the image to the text
- color: transparent 👉 make the text invisible (to see the image behind it)
- A simple
@keyframesanimation
That’s it.
Just a few lines of code and your typography comes alive.
- No libraries.
- No DOM hacks.
- No bloat.
Perfect for hero sections, portfolios, landing pages, or even just showing off what CSS can do.
It’s part of a growing mindset:
Use less JS. Push CSS further.
There’s a lot you can build without JavaScript, and it’s more fun than you think.
If you liked this tip, you might enjoy the book, which is packed with similar insights to help you build better websites without relying on JavaScript.
Go check it out https://theosoti.com/you-dont-need-js/ and enjoy 20% OFF for a limited time!