This post will cover backgrounds (for DIVs) and transparent images (.PNGs)
As we ALL know; IE6 poses far too many challenges for designers, resulting in seperate stylesheets and hacks.
I found the need for a transparent background with links on top of it, in Firefox & Safari (and IE7) PNGs are supported, so all worked fine, but when tried with IE6, Yea, there were PROBLEMS! No PNG support and links within the transparent window disappeared.
There are links to the PNGs and Demos at the bottom of the post.
This is the difinitive way to make transparency work with all browsers!
CSS code for STANDARD supporting browsers (Firefox, Safari).
.transparent { position: absolute; top: 10px; left: 10px; width: 200px; height: 250px; border: 1px solid #000; background: url('../images/blackTransparent80.png'); z-index: 1; }
CSS code for IE6 (hack). this is put in the style-sheet as well.
(The ‘*html’ only works on IE and is ignored by all other browsers.)
*html .transparent { position: absolute; top: 10px; left: 10px; width: 200px; height: 250px; border: 1px solid #000; background: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/blackTransparent80.png', sizingMethod='scale'); z-index: 1; }
This code is the code for the DIV
<span style="position: relative; top: 1px; left: 1px;"> <a href="http://nodstrum.com">nodstrum.com</a> </span> <span style="position: relative; top: 90px; left: 270px;"> <a href="http://blue44.com">blue44.com</a> </span> <span style="position: relative; top: 200px; left: 70px;"> <a href="http://teenfirst.com">teenfirst.com</a> </span>
Here are the links to my pre-made transparent backgrounds and the demos.
Transparency Demo – White
Transparency Demo – Black
White 80% Transparent PNG (1px x 1px)
Black 80% Transparent PNG (1px x 1px)
Enjoy!

Note: using the CSS style call…
“opacity: 80%;”
will, in IE make, everything opaque, including the text, forms etc.. Aviod at all costs, unless you really have to!
Won’t work in IE unless it’s a fixed image size. The background PNG (from what I can see) doesn’t repeat by default. If I’m wrong, let me know.
Hi Lance,
My examples work on IE6 (XP Pro SP2).
What version are you running, and do they work on it?
Jamie
Thanks to Jamie for all his efforts!
I had problems with IE as well. With FF no problems at all. Now i have changed only some text [css] and now it works just fine.
I used this css code:
.transparent {
position: absolute;
top: 0px;
bottom:0px;
left: 0px;
right:0px;
width: 500px;
z-index: 1;
background-image: url(‘images/blackTransparent80.png’);
overflow: auto;
}
*html .transparent {
position: absolute;
top: 0px;
bottom:0px;
left: 0px;
right:0px;
width: 500px;
z-index: 1;
background:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’images/blackTransparent80.png’, sizingMethod=’scale’);
}
This site is interesting and very informative, nicely interface. Enjoyed browsing through the site
Your home page is very friendly and rich with information! Thanks!
Very helpful article, thank you!
Thanks for the reply. I’ll try it as soon as possible.
Hi Lance,
My examples work on IE6 (XP Pro SP2).
What version are you running, and do they work on it?
Jamie
[...] preocupación es que el contenido se muestre opaco también en Firefox. Al hilo de un artículo de Jamie en Nodstrum, cuya lectura recomiendo, podemos llegar a la siguiente solución (ver ejemplo en el lab: [...]
Hi there,
Thanks for the demonstrations! However, when I try to link images, the links won’t work..do you know the workaround on that?
THANKS!
I’m sorry but this is not working on ie6, for some reason the background image is not loading. Testing on virtual machine win2003 with ie6.
There is a smiley in your code, a bit confusing
But it works pretty well. Thanks!
Dear Sir.
CSS stands for Cascading Style Sheets. Styles define how to display HTML elements and Styles were added to HTML 4.0 to solve a problem, External Style Sheets can save a lot of work and External Style Sheets are stored in CSS files.
CSS defines HOW HTML elements are to be displayed.
Styles are normally saved in external .css files.
Web Designing Company
THANKS
does NOT work in IE6. Nice try though