Omicron Llama

Coding all day, every day.

CSS Opacity in IE

This really pissed me off, and took me the best part of an hour to figure out.

With CSS you can set transparency on a container element such as a div, using filter:alpha(opacity=X) where X is a number between 0 and 100 representing percentage of opacity.

What ISN’T stated ANYWHERE is that the container div that will be transparent, for some reason MUST have a bloody height parameter defined!! ARGH!

See Example 3 at this website:
http://www.w3schools.com/Css/css_image_transparency.asp

Copy and paste that html code into an empty text file, give it an html file extension and open, should work lovely (remember to change the background:url() bit to point to a file that actually exists).

Remove the height parameter from the div.transbox stylesheet element and it breaks.

WHAT GIVES!?

*fumes*

Leave a Reply

Your email address will not be published. Required fields are marked *