Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox text gradient

Tags:

css

firefox

I was wondering if there is a way to apply a text gradient in Firefox? I can get it to work in Chrome and Safari and the code goes like:

h1 {
    background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#000000));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    text-transform: uppercase;
    font: bold 4em "Lucida Grande", Lucida, Verdana, sans-serif;
}

But there doesn't seem to be anything out there for Mozilla.

like image 826
Nsokyi Avatar asked Apr 14 '12 17:04

Nsokyi


People also ask

Can I use linear gradient on text?

Instead, use them to make headings or specific words more eye-catching. What might surprise you — especially if you have prior experience with design tools — is that you can't set a gradient as the text color directly. For example color: linear-gradient(yellow, red) won't work.

What is linear and radial gradient?

CSS defines three types of gradients: Linear Gradients (goes down/up/left/right/diagonally) Radial Gradients (defined by their center) Conic Gradients (rotated around a center point)

What is radial gradient?

The radial-gradient() CSS function creates an image consisting of a progressive transition between two or more colors that radiate from an origin. Its shape may be a circle or an ellipse. The function's result is an object of the <gradient> data type, which is a special kind of <image> .


2 Answers

Unfortunately, I think only WebKit-based browsers implement the text-fill-color property. As far as I'm aware, there is no workaround for Mozilla yet.

like image 145
BenM Avatar answered Sep 22 '22 16:09

BenM


FireFox does now appear to support the webkit parameters, aliasing -webkit-background-clip as background-clip (webkit doesn't alias it, hence the most compatible way at present appears to be to use -webkit-backgroup-clip as both FF and WK understand it)

enter image description here

like image 41
Caius Jard Avatar answered Sep 24 '22 16:09

Caius Jard