David Hucklesby wrote:
> Emanuele Venezia wrote:
>> Wouldn't it be enough to use a semi-transparent image as background for the contained
>> div? (it would be CSS21 compliant, too)
> Absolutely. Sadly, though, the most used browser today, IE6, will not
> apply alpha transparency to repeated background images. To my
> knowledge, anyway - not even with "PNG Fix":
That's not true. The part you've been missing is the sizingMethod param
to AlphaImageLoader() . You need to scale it.
I've used a translucent image as a BG on several occasions to get around
this exact problem. Open a 2x2 pixel image  in Photoshop or GIMP,
fill with white, and set your desired transparency. I like to make
several and name them like, 'bg_FFF_30.png', etc.
For IE one can use, eg. pngbehavior.htc  or something along the lines of:
-- snip --
var trans_boxes = document.getElementsByClassName('div', 'whatever');
for (var i = 0; i < trans_boxes.length; i++)
var blankSrc = '/images/spacer.gif';
/* parse out the existing BG image
var bgImageSrc = el.currentStyle.backgroundImage;
bgImageSrc = bgImageSrc.substring( bgImageSrc.indexOf('url("') + 5,
/* sub in the GIF foor poor, old IE
el.style.backgroundImage = 'url(' + blankSrc + ')';
/* run the magic filter 
* note the sizingMethod='scale'
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bgImageSrc
-- snip --
 Be sure to use a 2px-wide image because Safari 2.x has a bug that'll
cause a 1-pixel image to become opaque. This was a rather ugly surprise
when Safari was updated with Tiger.
 I'll leave it as an exercise to the reader to find their favourite
getElementsByClassName(). This is a CSS list, after all.
 Admittedly, this filter is not the panacea it may seem. It has been
known to cause much gnashing of teeth with regard to, say, links no
longer working. Another exercise for the reader, i guess.
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/