Forum Moderators: not2easy
I found a web page that suggests AlphaImageLoader by using the following code:
img {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(...);
}
It didn't work for me, but then again, I may have incorporated it wrong as the site didn't clearly tell me where to place it.
This is my current code:
.post .title {
height: 55px;
margin-bottom: 3px;
padding: 19px 0px 2px 20px;
background: url(images/title_header.png) no-repeat left top;
color: #FFFFFF;
}
Any ideas how I can manipulate this situation to work in IE6?
.post, .title {
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/title_header.png');
}
will do the business for you, but make sure to put it inside a conditional comment so it'll only affect IE5.5 - 6. Later versions don't need it, and IE5 doesn't support it.
I've used a dozen or so instances on a page with no noticeable slowdown, but your best bet is to do some testing and see for yourself.
Here's the code I entered:
.post .title {
height: 55px;
margin-bottom: 3px;
padding: 0px 0px 2px 20px;
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sm_title_header.png');
color: #FFFFFF;
}
Oh, btw:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Works wonderfully in IE6, but the images have completely disappeared in Firefox. Is that expected?
"filter" is a non-standard setting. Any compliant browsers should ignore the line and that would mean in your example that there's no image referenced at all.
You need to keep your background-image statement for all the complaint browsers.
Try validating your CSS: it'll flag this as a syntax error.
The solution is as indicated above to use conditional comments to feed it only as a workaround for the browsers made to be not compliant with the standards.
I'm not sure if this helps, but the following code shows the images that are NOT showing up in the browser:
#wrapper {background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/top_curly.png') center top fixed no-repeat;
}
#wrapperb {background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bottom_curly.png') right bottom no-repeat;
}
#sidebar li {
margin-bottom: 30px;
padding: 0;
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bg2.png') no-repeat left bottom;
}
#searchform div {
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bg2.png') no-repeat left bottom;
padding: 0px 10px 10px 10px;
margin-bottom: 30px;
line-height: 1;
}