wsg  

Re: [WSG] old underscore hack question

David Hucklesby
Sat, 19 Jul 2008 16:16:27 -0700

On Fri, 18 Jul 2008 23:52:44 +0100, kevin mcmonagle wrote:
> hi,
> i want to use the underscore hack instead of conditional comments because it 
> will be
> easier to keep track of image paths. Its only an ie6 because transparency 
> workaround.
> In my understanding the below code should only serve the gif to ie 6, not 
> later
> versions?
> but IE net renderer is rendering the gif in all ie versions. Its not really 
> like that
> in a real "life" right?
>
> #shell{
> background:url(../images/bgshad.png);
> _background: url(../images/iebg.gif);
> margin:0 auto;
> background-repeat:repeat-y;
> }

You are correct. The underscore hack works with IE 5 and 6 only.
An extension of this is to use an asterisk instead of an underscore
to hack for IE7 as well. Obviously you don't need that, but I mention
it for completeness.

FWIW - I use these hacks while fixing up IE oddities during development.
I think it preferable to use another technique for the final cut, though.
Something like the one Manny Blum suggests looks good.

Also perhaps relevant, or perhaps not -- you can combine GIF-like
binary transparency with alpha transparency in a single 8-bit PNG.[1][2]
Not so good if you really do need more colors, but an alternative.

[1] <http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/>
[2] <http://www.sitepoint.com/blogs/2008/03/20/making-ie6-friendly-png8-images/>

Cordially,
David
--



*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************