I'm attempting to give some text a 3D effect by applying a shadow, but I am struggling to position the shadow behind the text. No matter how I adjust it, the shadow ends up either on top or completely distorted. Here is a link to a JS Fiddle with my code:
https://jsfiddle.net/2azp5z36/2/
The issue is that the shadow appears in front of the text instead of behind it.
If you have a different method that could achieve the same visual effect (except for the shadow's placement), I would be interested in hearing it. However, there is one requirement: any solution provided must only involve HTML, CSS, and/or JavaScript (preferably HTML5 & CSS3).
h1.CV:before {
/*text-align: center;*/
background: none;
content: attr(data-text);
/*left: 0;*/
position: absolute;
text-shadow: 5px 5px 2px rgba(0, 0, 0, 0.75); /*X,Y,BlurRadius,Color*/
top: 0;
z-index: -1;
}
h1.CV {
/* http://jsfiddle.net/2GgqR/258/ */
text-align: center;
font-size: 10em;
background-image: -webkit-linear-gradient(red, orange, yellow);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
position:relative;
z-index: 0;
}
<h1 class="CV" data-text="CV">CV</h1>