IE Gradient filter colors are way off

If you're using gradients within your CSS, you may have encountered an issue with colors in IE. The problem is that the filter parameters don't allow the RGB shorthand color notation like standard CSS does.

For, example, if you're using:

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888', endColorstr='#bbb');

Internet Explorer will assume that your RGB color values are simply incomplete (as opposed to assuming that they are shorthand).

Using the full hexadecimal RGB color value will resolve the issue.

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#bbbbbb');

Why follow me on Twitter?

  • I tweet about new technologies, services or libraries I find interesting
  • Yeah, sometimes I'll post a pet-peeve or rant about something trivial
  • If I discover something that made my web development life easier, I share it
  • I'll shout out any handy tip that I think might be useful to other devs
  • Very rarely anything promotional


Tagged .

Updated: 2012-10-20

Phil LaNasa follow us in feedly