Reputation: 446
Trying to animate the transparency of a text using -webkit-text-fill-color
a {
color: #fff;
-webkit-text-fill-color: rgba(255,255,255,0);
-webkit-text-stroke-width: 2px;
-webkit-text-stroke-color: #fff;
-webkit-text-stroke: 2px white;
-webkit-transition: all .5s ease-out;
-moz-transition: all .5s ease-out;
-o-transition: all .5s ease-out;
transition: all .5s ease-out;
}
a:hover {
-webkit-text-fill-color: rgba(255,255,255,1);
}
I cant set the color to transparent because of compatibility issues of -webkit-text-fill-color and -webkit-text-stroke on IE.
Upvotes: 4
Views: 2820
Reputation: 6743
Sorry I don't have IE browser to test it on my mac, Please try this code
a {
color: #d5d5d5;
-webkit-text-fill-color: rgba(225,255,255,0);
-webkit-text-stroke-width: 2px;
-webkit-text-stroke-color: #d5d5d5;
-webkit-text-stroke: 2px #d5d5d5;
-webkit-transition: all .5s ease-out;
-moz-transition: all .5s ease-out; /*gecko*/
-ms-transition: all .5s ease-out; /*IE10*/
-o-transition: all .5s ease-out; /*opera 11.10+*/
-pie-transition: all .5s ease-out; /*PIE*/
transition: all .5s ease-out;
}
a:hover {
color: #000;
-webkit-text-fill-color: rgba(255,255,255,1);
-webkit-text-stroke-width: 2px;
-webkit-text-stroke-color: #000;
-moz-transition: all .5s ease-out; /*gecko*/
-ms-transition: all .5s ease-out; /*IE10*/
-o-transition: all .5s ease-out; /*opera 11.10+*/
-pie-transition: all .5s ease-out; /*PIE*/
transition: all .5s ease-out;
}
<a href="#">Test</a>
Upvotes: 2