On my website, I'm using a text gradient for the heading, but it only works on Chrome and probably Safari (although I haven't tested it), below is the code I'm using for the gradient. I was wondering whether there was a way to achieve the same/similar effect that would work across all 3 browsers?
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
EDIT: The problem with the other solution that's been posted is that it only works on a white background, as someone said in the comments, which is no good for me as I'm using a grey background.
If you want this to work in non-WebKit browsers, you need to use a solution other than CSS.
There are some JavaScript solutions out there, or you can use SVG.
Here's a good blog post on how to do it: http://lea.verou.me/2012/05/text-masking-the-standards-way/
Using JavaScript has the downside of... using JavaScript, but at the end of the day this is only a decorative visual effect.
-moz-background-clip:text does not work on firefox, and you won’t be able to achieve clipping effect in Firefox.
You can use cufon for the text gradients, and thay will work on IE, Chrome and Firefox
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With