Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>IE8 Transparency</title>
<script type="text/javascript">
doIt = function () {
document.getElementsByTagName('h1')[0].style.position = "relative";
document.getElementsByTagName('h1')[0].style.width = 300+"px";
document.getElementsByTagName('h1')[0].style.height = 30+"px";
document.getElementsByTagName('h1')[0].style.filter = 'alpha(opacity=' + 10 + ')';
document.getElementsByTagName('img')[0].style.filter = 'alpha(opacity=' + 10 + ')';
}
</script>
</head>
<body onClick="doIt()">
<h1 style="background:#ff0000;)">main heading</h1>
<img src="img/img1.png">
<h2 style="position:relative; top:0; left:0; width:240px; height:30px; background:green;
filter:progid:DXImageTransform.Microsoft.Alpha( Opacity=10)">
2nd heading</h2>
<img src="img/img2.png" style="filter:progid:DXImageTransform.Microsoft.Alpha( Opacity=10)">
</body>
</html>
If you use a correct doc type you can set opacity through Javascript on images but not on other elements.
opacity doesn't seem to work in css.
No doc type opacity works fine on anything.
Think I've got this right?
[w3.org...]
Nothing else please!
By the time we get IE8 widely deployed to replace IE6 and IE7 nobody will want to have to mess with those experssions and conditional comments anymore.
There's always hope they'll eventually still fix it, or that all will stop using IE.