1

I found a Stackoverflow article on creating text shadows in IE: StackQuestion Now I tried all of the 'filter' solutions in there, and in IE9, the text renders horrible(although the shadow shadow shows, the text pixelates heavily...).

Does anyone know of a proper text-shadow technique for IE? Even if it is just for IE9...

Thank You

Dexter Schneider
  • 2,494
  • 7
  • 25
  • 28
  • possible duplicate of [css3 text-shadow in IE9](http://stackoverflow.com/questions/6905658/css3-text-shadow-in-ie9) – feeela Jul 27 '12 at 10:47
  • Thanks, but it still renders horrible. I guess I'll just have to wait for IE10. – Dexter Schneider Jul 27 '12 at 12:22
  • 1
    You should set up a public test-case to get more help. Anybody else is able to have text-shadows even in IE7, so there must be some solution… – feeela Jul 27 '12 at 12:28

3 Answers3

3

Check this site out: http://css3pie.com/

It's a plugin that enables you to use CSS3 in IE6-9

Zachary Kniebel
  • 4,686
  • 3
  • 29
  • 53
  • Unless I'm going mad and missed something obvious, CSS3PIE supports `box-shadow` but not `text-shadow` (actually [this post seems to confirm that text-shadow isn't supported](http://css3pie.com/forum/viewtopic.php?f=4&t=1135) ) – user56reinstatemonica8 Dec 18 '12 at 02:13
  • I know that it is supported in IE8 and 9, though it is a bit rough – Zachary Kniebel Dec 18 '12 at 12:03
1

You can get text-shadow effects in Internet Explorer, taming IE's crunky filter shadow effects, forcing them to look okay and stop pixelating the text. Use the IE Chroma filter:

  • Set a background colour that is close to, but not the same as, your shadow colour - e.g. for black shadows, a dark grey, for white glows, a light grey
  • (set the background colour in a stylesheet or style rule inside an IE-only class or conditional comment, to not wreck your design in every other browser!)
  • Precede your IE filter CSS rule with a Chroma filter set to the same colour as the background fill
  • It looks (almost) quite good!

jsfiddle examples (load in IE8, IE9)

...or if you don't have easy access to IE8/9, here's a screenshot from that fiddle in IE9 IE8 mode. Notice the difference between the horrible, artifact-ridden, pixelated mess that is IE's default filter, against the quite crisp, normal-looking Chroma filter equivalents.

enter image description here

CSS code examples. Note how you've got a Chroma filter then another filter, all on one line, in quotes against one -ms-filter - and how the Chroma colour matches the background colour precisely, and how the Chroma colour compliments (but doesn't match) the main effect colour:

.chroma-glow {
    background-color: #dfdfdf;
    -ms-filter: "progid:DXImageTransform.Microsoft.Chroma(Color=#dfdfdf)progid:DXImageTransform.Microsoft.Glow(color=ffffff,strength=4)";
}
.chroma-shadow {
    background-color: #dfdfdf;
    -ms-filter: "progid:DXImageTransform.Microsoft.Chroma(Color=#dfdfdf)progid:DXImageTransform.Microsoft.Shadow(direction=135,strength=2,color=ffffff)";
}

Some requirements (learned the hard way...)

  • Elements must be block or inline-block, can't be inline.
  • Filters fail to apply to any children that are position: relative; or position: absolute;
    • (they work if applied directly to position: absolute; or `position: relative; elements)
  • If you're adding the filters dynamically, e.g. with jQuery like $elem.css('filter','progid...');, it seems like the background colour must be applied directly to the element with the filter for the chroma to work. A couple of tips:
    • Have the effect colour, applied background colour, and chroma colour all identical
    • Since you'll want this background colour only in IE, use feature detection or IE detection.
user56reinstatemonica8
  • 32,576
  • 21
  • 101
  • 125
0
#element {  
    filter: glow(color=black,strength=5);  
}  
Tiago Moutinho
  • 1,372
  • 1
  • 13
  • 18