This content originally appeared on Bram.us and was authored by Bramus!
Fun demo by Elad Shechter:
See the Pen Background-clip: text with Animated Emoji by Elad Shechter (@elad2412) on CodePen.
Behind it are two techniques:
-
The ? emoji is set as the
background-image
of the text. To do so one must wrap it inside an SVG, and successively inject the SVG using a Data URL. - To clip the emoji to the foreground text, he uses
background-clip: text
.
I like the fact that these techniques by themselves are not new, yet their combination is (at least to me this was the case):
- The “Emoji in SVG”-technique allows you to have an Emoji Mouse Cursor or use an emoji as favicon.
- Using
background-clip: text
works on any background image. As gradients can also be set as background images, you can create gradient links.
This content originally appeared on Bram.us and was authored by Bramus!
Bramus! | Sciencx (2021-03-14T23:37:30+00:00) CSS background-clip Demo: Text with Animated Emoji. Retrieved from https://www.scien.cx/2021/03/14/css-background-clip-demo-text-with-animated-emoji/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.