3

I was playing around with this gradient generator and noticed that in the filter property, they use a variation of the common place hexidecimal color code:

#00ffffff

to seemingly acheive an rgba effect: Permalink

I also saw this method mentioned here. Does this work in IE? What versions of IE support this?

I did see this question, but the answers never really mentioned if IE supports it. They just said it's invalid.

If IE does support this then it really makes no sense to use semi-transparent PNGs. Right?

Community
  • 1
  • 1
Web_Designer
  • 72,308
  • 93
  • 206
  • 262

1 Answers1

5

The color code #00ffffff stands for 0x00 alpha, 0xFF red, 0xFF green and 0xFF blue. This basically means completely transparent white. MSDN has a nice description of this notation.

The #AARRGGBB notation is used by MSIE filters only, and should be supported by IE5.5+ within the (-ms-)filter functions. It's not a valid color expression in CSS, so cannot be used with color, background-color et al, not even in IE.

Indeed, the use of gradient filters is a common workaround for CSS3 rgba() and gradients for older versions of IE which don't support them. However, as filters often cause layout problems (which I shan't elaborate on), many including myself opt to use semitransparent PNGs as background images instead.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • I actually just learned about this yesterday, funny it should come up. I hate having to edit colors in Photoshop instead of a CSS file. What's a good resource for learning about the filter-related layout problems you mention? – Wesley Murch Mar 19 '12 at 20:52
  • @Madmartigan: I don't have any resources, sadly - it was part hearsay and part personal experience. The "layout" I mention refers to `hasLayout`, so that could be an excellent search term to use. – BoltClock Mar 19 '12 at 20:57
  • Hello from the future! As a somewhat relevant note, the CSS Color Module Level 4 will *probably* support 4 and 8-digit hexadecimal RGBA notation. http://stackoverflow.com/a/27802062/1317805 – James Donnelly Jan 06 '15 at 15:47
  • @James Donnelly: Eeyup, been a long time coming. I hope it gets implemented. – BoltClock Jan 06 '15 at 15:48