Line25

Using CSS Text-Shadow to Create Cool Text Effects

Using CSS Text-Shadow to Create Cool Text Effects
Home » Articles » Using CSS Text-Shadow to Create Cool Text Effects

August 22, 2017

Line25 is reader supported. At no cost to you an affiliate commission may be earned when a purchase is made through various links on our site. Learn more

Learn how to use the CSS text-shadow to create cool text effects, by following this easy, step by step tutorial. Check it out and start learning!

The CSS3 text-shadow property has been around for some time now and is commonly used to recreate Photoshop’s Drop Shadow type shading to add subtle shadows which help add depth, dimension and to lift an element from the page. This isn’t all the text-shadow property is capable of though, by getting creative and playing around with the colours, offset and blurring we can create some clever and pretty cool text effects!

View the text-shadow effectsPin

Check out the six text effects of vintage/retro, inset, anaglyphic, fire and board game in the demo, then copy the code snippets below to use the effects in your own designs. Needless to say you’ll need a text-shadow supporting browser (Safari, Chrome, Firefox) to see them in all their glory.

View the demo

How text-shadow works

How the CSS text-shadow property worksPin

The text shadow CSS property is used to add shading to any text related HTML element. The syntax includes figures for the X-offset, the Y-offset, the blur amount and finally the colour of the actual shadow. What’s more, you don’t have to settle with one shadow, you can build up multiple text-shadow values to create some really cool effects!

Vintage / Retro text effect

Vintage text-shadow effectPin

text-shadow: 5px 5px 0px #eee, 7px 7px 0px #707070;

How it works:

The vintage style text effect is made up of two text shadows, but the first is set to the same colour as the background in order to give the impression that the second shadow (the thin dark grey one) is offset to the bottom right. Remember to make sure your first shadow colour is set to the same colour as your page background, and the text and second shadow also both use the same colour.

View the demo

Neon text effect

Neon text-shadow effectPin

text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #ff00de, 0 0 70px #ff00de, 0 0 80px #ff00de, 0 0 100px #ff00de, 0 0 150px #ff00de;

How it works:

The neon text effect is made up of 8 levels of shading. The base text is given a white fill, then each of the 8 text-shadow values are given larger and larger blur amounts while also getting darker. This blends between a vivid white inner glow and the large purple outer aura.

View the demo

Inset text effect

Inset text-shadow effectPin

text-shadow: 0px 2px 3px #666;

How it works:

The inset or letterpress style text effect is one of the more common uses of text-shadow. The shadow is offset on the Y-axis by a tiny amount to give the impression of a subtle highlight. On dark backgrounds offset the shadow underneath the text with a light colour, whereas on light backgrounds offset to the top of the text with a darker shadow colour.

View the demo

Anaglyphic text effect

Anaglyphic text-shadow effectPin

text-shadow: 8px 8px 0 rgba(255,0,180,0.5);

How it works:

The anaglyphic text effect recreates the cool effect used on old 3D images. The effect is recreated with CSS using a mix of text-shadow and RGBa colouring. Using RGBa on the text and the shadow allows the alpha channel to be set to 50% transparency so the underlying text is visible through the shadow.

View the demo

Fire text effect

Fire text-shadow effectPin

text-shadow: 0 0 20px #fefcc9, 10px -10px 30px #feec85, -20px -20px 40px #ffae34, 20px -40px 50px #ec760c, -20px -60px 60px #cd4606, 0 -80px 70px #973716, 10px -90px 80px #451b0e;

How it works:

The fire text effect is another style that uses multiple levels of shading. Each shadow is offset in different directions, uses various blur settings and blends a range of warm colours to create the impression of a flame. These colours span from bright whites through to yellows, oranges and darker amber tones.

View the demo

Board Game text effect

Board Game text-shadow effectPin

text-shadow: 10px 10px 0 #ffd217, 20px 20px 0 #5ac7ff, 30px 30px 0 #ffd217, 40px 40px 0 #5ac7ff;

How it works:

The board game text effect simply uses multiple shadows each with an increasing amount of offset from the original text to create an alternating series of colours. No blurring is used to keep the shadows crisp and sharp as exact reproductions of the original text.

View the demo

Written by Iggy

Iggy is a designer who loves experimenting with new web design techniques, collating creative website designs, and writing about the latest design trends, inspiration, design freebies, and more. You can follow him on Twitter

61 Comments

Would you like to say something?

  1. Will says:

    This is SOOOOOOoooooooo COOOL! Totally amazing how you can create those incredible graphic text images using CSS alone. I was thinking the text was created with photoshop when I first saw the text. This is totally awesome. Thank you so much for sharing.

  2. نیمکت شهری says:

    Very beautiful effects
    Thank you

  3. Sejfy says:

    Very nice effects, pretty and clean, delicious :]

  4. covalic says:

    Great post. Thx :)

  5. Advitum Webdesign says:

    Great article! I just got the idea to make a 3D-page with the anaglyph-effect…

  6. leo says:

    shame on IE for not following this.

  7. Datshay says:

    WoW !!!
    I just like the neon……. great….

  8. Jrutlanddesign says:

    great post, I love the INSET, looks so nice when its done well, also the anaglyphic one is really nice

  9. Dave says:

    awesome stuff, i'm sure to steal a few of those :) thanks again

  10. nate says:

    Really neat effects, but I have to kill the cat…they are all pretty difficult to read…

  11. toun says:

    text-shadow property is amazing! shame on IE for not following this.

  12. David says:

    It just goes to show the power of what css is actually able to achieve coupled with some imagination and time.

    Great post

  13. webtrendset says:

    It's definitely awesome work
    Thankyou…

  14. G Downs says:

    Love it. Now i need to create a web design for a client that i can use this with… can't wait

  15. astrology says:

    neat effects, chris. thanks for the pointers. appreciate all the tips on website design, especially css. kudos to all the contributors!

  16. Monica Reyes says:

    I'm definitely going to try out the vintage retro text effect, thanks!

  17. Paweł P. says:

    Great examples!
    Best regards!

  18. Bruno says:

    Wordpress with CSS text shadow will be nice, i would try out. Thank you to share.

  19. inturias says:

    nice effects.. but.. only ie9…! :(

  20. Beben Koben says:

    would be nice if this effect we use the trick a:hover…hihihihi
    nice nice nice

  21. iGweb says:

    Merci pour ce post !!
    Exellement

  22. Greg Jeffries says:

    These techniques are freaking ridiculous. Thanks so much for sharing!

  23. Jeffery Thorp says:

    Thanks for sharing. Inset and and vintage are cool.

  24. margo utomo says:

    wow..great..very nice..thanks for sharing..

  25. Jeremy Carlson says:

    I already knew how to do multiple text-shadow effects, but these actually look good. Nice job!

  26. heath waller says:

    What a great tutorial, Chris! So concise. Great examples. I'm excited to try some of these out. The Anaglyphic in particular…

  27. Marc Heiligers says:

    Nice! Great little tutorial/demo. I also used the Neon sample to hack a little something together. Could use some tweaking, but it's got potential: https://fascinationstreet.co.za/untitled/neon.html

  28. Henrique Blefari says:

    Very Cool!
    Thanks for share!

  29. audee velasco says:

    Hey Chris! Thanks for the enlightenment the text-shadows can be put on top of each other.. I agree with @sanji ! Awesome post as usual!

  30. Birgit says:

    great stuff! I didn't know that you can apply multiple shadows like in "fire" – very impressive effect :)

  31. Aayush Shrestha says:

    This is simply great!! Chris! u'v been my css icon… thnx for every blog u'v written!! :)

  32. sanji says:

    wow! didn't know shadow can be stack like that, really like the vintage and inset. cool post! keep it up man!

  33. chipchops says:

    very nice. thanks for sharing.

  34. Gabriele says:

    NICE!!

  35. Buzz says:

    I thought I wasn't going to like these, but Vintage, Neon and Inset are great effects and the tuts are really handy… thanks!!

  36. Lee Gustin says:

    Love these! Thanks Chris

  37. Gabriel says:

    Nice FX!
    I start playing with this effects and some jquery and this is the experiment i did
    https://test.gabiton.com.ar/glow/
    Check it in chrome or safari, ff doesnt seem to handle it right… (hover in the text)

  38. Sean says:

    Love this, really like Anaglyphic.

  39. Nathaniel says:

    Excellent tutorial!

  40. Melanie says:

    Great article and great example of why I love reading your sit! Can't wait to try these out.

  41. Luis Lopez says:

    I love the INSET and VINTAGE… the other not so much, but all are Awesome, if you know how much time I spent first time "some months ago" learning how to make a nice text shadow, or an inset effect you'll see how happy I'm to see yous post.

  42. Sean Rainey says:

    Hey man, thanks very much.

  43. Fred says:

    Wow…thanks for the info…

  44. Jaina says:

    Had no idea you could stack the shadows like that. Love the effects!

  45. steve firth says:

    Sweet, didn't know you could stack multiple shadows.

  46. Amy @ Taste Like Crazy says:

    The Anaglyphic and Board Game effects are my favorites and now you've got me wondering where I should implement them.

  47. Jaff says:

    Very Nice.

  48. Pete says:

    This is awesome. Its a shame its real world application is restricted by IE.

  49. Roy says:

    Thanks for this tutorial, Chris!

  50. Alan says:

    Great tutorial Chris.

  51. Pavel says:

    Viva to CSS3!!! That IE cold be soo cool looking! They just don't get it!!

  52. Legycsapo says:

    It's possible to make the 'inset' to work on IE?

    Really nice tut thank you !!!

  53. andr says:

    Thank you!

    Vintage / Retro & Inset are especially cool!

  54. Laura says:

    Ooooooh! Nice!!!! Thanks for the how to's too! :)

  55. sagi says:

    So simple, yet creative, css bits, and its nice to have a bunch of them in one post.
    Chris, you rock man! :)
    Thanks

  56. Rudy Azhar says:

    Wow, this a new text-shadow effects Chris!

    I like the Anaglyphic text effect, thats good effect.

  57. Babak says:

    Awesome!
    really like the way you use the property to make these cool effects.

  58. Red says:

    Nice effects Chris!

    I especially like the #FIRE one. Thanks for sharing this!

Please Share