3D CSS Shadow Text Tutorial
36 Comments

This easy CSS text shadow tutorial will show you step by step how to create 3D font with multiple css shadows by stacking multiple CSS3 text shadow properties, then go a step further and use the CSS text transform and CSS transition properties to make the 3D text pop out / zoom on hover!
Please keep in mind this 3D CSS text shadow effect is pure CSS (No JavaScript) and the technique only fully works in modern browsers like Firefox, Chrome, Safari and Opera, It will fall back gracefully to plain text when viewed in any Internet Explorer browser.
How CSS shadow text works
To create this 3D CSS shadow text effect we are going to use the CSS 3 text-shadow property, this is how text-shadow works:
.example-class
{
text-shadow: [X offset] [Y offset] [Blur size] [Colour];
}
Stacking multiple CSS Shadows
You don’t have to stack multiple css shadows but it does create a better looking 3D CSS text effect.

The Tutorial (Creating the 3D CSS text shadow)
You will want to pick colours darker than the original text colour for the shadow, so for this example I will be using white text, with a 2 level deep grey shadow, followed by a 4 level deep near black shadow to create that 3D text illusion.
For this example I’m going to target a H2 tag, but you can target any HTML element, link, class, ID etc.
h2
{
text-shadow:
1px 1px 0 #CCC,
2px 2px 0 #CCC, /* end of 2 level deep grey shadow */
3px 3px 0 #444,
4px 4px 0 #444,
5px 5px 0 #444,
6px 6px 0 #444; /* end of 4 level deep dark shadow */
}

Well, you can stop there if you like, you have your basic 3D CSS text illusion, using multiple shadows.
However, let’s go two steps further and make the text size increase on hover by using the CSS text transform property to have the 3D text pop out / zoom in & out on hover! Then have it fade in and out smoothly with a CSS transition, pure CSS3, no JavaScript required!
Increasing text size on hover with CSS text transform
h2:hover
{
/* CSS3 Transform Effect */
-webkit-transform: scale(1.2); /* Safari & Chrome */
-moz-transform: scale(1.2); /* Firefox */
-o-transform: scale(1.2); /* Opera */
}

You can make the text bigger by changing the (1.1) value, (2.0) would be double the original size.
This instant CSS text transform on hover could use some improvement however, so we are going to make it fade in and fade out over a few milliseconds.
Making the cSS transition on hover smooth
h2
{
/* CSS3 Transition Effect */
-webkit-transition: all 0.12s ease-out; /* Safari & Chrome */
-moz-transition: all 0.12s ease-out; /* Firefox */
-o-transition: all 0.12s ease-out; /* Opera */
}
Now the text size grows larger on hover and goes back to it’s normal state in a smooth CSS transition, you can increase or lower the speed by changing the 0.12s value.
View Demo That’s it! You’ve created your 3D CSS shadow text effect with multiple css shadows!
Share or Save!
[...] If you want more details of how it works, check-out the tutorial by pgwebdesign [...]
[...] … and many other fun effects using a CSS->Canvas converter (CSS sourced from Line25, and Stereoscopic, and Shadow 3D) [...]
[...] 26. 3D CSS Shadow Text Tutorial [...]
[...] differs from others because besides default text-shadow it also uses inner shadow property.26. 3D CSS Shadow Text TutorialThis easy CSS text shadow tutorial will show you step by step how to create 3D font with multiple [...]
[...] 26. 3D CSS Shadow Text Tutorial [...]
Yeah during the animation the shadow effects arent there…. ‘nice’.
If you move the mouse quickly from on/off the text you can see it is merely white text with the drop shadow when it is :active?
I’m not sure…
[...] To get things started, let’s see how <canvas> can emulate CSS effects. Searching through Google images for “css text-shadow” led to a few great demos for us to emulate; Line25, and Stereoscopic, and Shadow 3D. [...]
Thank you for this. I haven’t seen much on using multiple shadows. You made it super easy to understand :)
[...] Source Demo [...]
[...] 13、3D CSS3阴影文字教程 3D CSS阴影文字教程 [...]
[...] was made in Photoshop 11. CSS Custom Fonts Tutorial 12. I Heart Blur 13. 3D CSS Shadow Text Tutorial 14. How to Create Inset Typography with CSS3 15. How to Create a Cool [...]
Excellent tutorial! I had never thought of using multiple text shadows to create a smooth 3D effect like that.
[...] 3D CSS Shadow Text Tutorial 35 Fantasy Art Masterpieces of character design history [...]
[...] 26. 3D CSS Shadow Text Tutorial [...]
[...] 13、3D CSS3阴影文字教程 3D CSS阴影文字教程 [...]
[...] 3D CSS Shadow Text Tutorial [...]
I like to use css3, but its to risk, because not all browser support css3. Can you give me suggestion?
[...] 3D CSS Shadow Text Tutorial - Ever wonder how to make your header text look 3D and pop out with you hover your mouse over it? Try this phenomenal tutorial! Keep in mind that this could also be a great effect for header text. [...]
[...] 26. 3D CSS Shadow Text Tutorial [...]
[...] 13. 3D CSS Shadow Text Tutorial [...]
[...] 3D CSS Shadow Text Tutorial [...]
[...] 13. 3D CSS Shadow Text Tutorial [...]
I don’t even know how I finished up here, but I believed this submit used to be great. I do not understand who you’re but definitely you’re going to a well-known blogger should you aren’t already. Cheers!
[...] 6) 3D CSS Shadow Text [Tutorial] [...]
[...] 教程 / 演示 [...]
[...] 3D CSS Shadow Text [Tutorial] [...]
[...] Visit Source – by PG Web Design [...]
[...] 下面这篇教程是教你如何用CSS3来制作3D效果的文字,文章翻译自3D CSS Shadow Text Tutorial。 [...]
36 Comments [ Leave a comment ]