user1171523
user1171523

Reputation: 271

Mozilla CSS hack for text shadow

I am trying to create a text shadow in Mozilla browsers only. (I'm using this as a workaround for some issues with a font that I'm using.)

I have tried -moz-text-shadow, but it seems that this is now defunct and it no longer needs the moz extension. But I don't want Internet Explorer and WebKit to use the text shadow.

Why would the -moz function be taken away?

Upvotes: 2

Views: 7242

Answers (3)

Ariona Rian
Ariona Rian

Reputation: 9437

-moz, -webkit, -o, and -ms are called browser prefixes. They are used for browsers that didn't support the property fully.

And now every modern browser except Internet Explorer 8 and lower support the text-shadow property.

You can use JavaScript to detect the browser and add the text shadows property if you want to force adding a text shadow for just Firefox.

Upvotes: 1

Andres I Perez
Andres I Perez

Reputation: 75379

You can target Firefox alone by using a CSS hack, such as:

body:not(:-moz-handler-blocked) a { background-color: red; }

Quick demo: http://jsfiddle.net/DxjeL/

The box should be red for Firefox and blue for all the other browsers.

This is from Browser CSS Hacks.

Upvotes: 5

Draven Vestatt
Draven Vestatt

Reputation: 87

Rough example:

text-shadow: 0 0 transparent;
-webkit-text-shadow: 0 0 transparent;
-khtml-text-shadow: 0 0 transparent;
-moz-text-shadow: 1px 1px #ff0000;

Upvotes: 0

Related Questions