Hollow text hover effect with only three lines of CSS
Recently, I was checking Life At Spotify website and spotted this cool hollow text hover effect on the page. It looks like this.
Turns out, it only takes three lines of CSS to achieve this effect. Here’s how.
As you can tell, it’s the combination of
-webkit-text-stroke-color CSS properties that make this effect possible.
-webkit-text-fill-color property specifies the color of the text. The
-webkit-text-stroke-width property specifies the width of the stroke around the text. The
-webkit-text-stroke-color property specifies the color of the stroke around the text.
All of these properties are supported by all major browsers as well. So, you don’t have to worry about browser compatibility.
Here’s a CodePen for you to play around with.
Fun fact: I liked it so much that I’ve implemented this effect on my website’s name in the header as well!
Like this article? Consider leaving aTip