Forum Moderators: not2easy

Message Too Old, No Replies

IE6 Issues - Really could use some help

I've been working on this for awhile, I could really use some direction.

         

CWitt

5:13 am on Oct 23, 2008 (gmt 0)

10+ Year Member



I've been picking up tips from this site for a little while, but it seems I am now the one with the need for help.

I'm developing a site at <snip> and I am having an issue with IE6. Anyway, the tabs along the top below the header are causing a slight spacing issue. Also, those tabs are supposed to register as being opaque, but I understand IE6 doesn't care. I have a JS running a PNG fix, perhaps it is not working correctly. Last but not least the footer just isn't displaying correctly. The footer image is larger as you can see in Firefox 3 & IE7.

IE6 Issues:

*Header/Tabs spacing
*Tabs opaque
*Footer

If anyone can shed some light on any of my CSS issues, it would be greatly appreciated. Thanks a bunch guys.

- Chad Wittman

[edited by: swa66 at 9:11 am (utc) on Oct. 23, 2008]
[edit reason] No personal URLs, please see forum charter [/edit]

swa66

9:19 am on Oct 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it's easiest to focus on one problem at a time. Post some minimal code that still exhibits the problem and we all can have a look.
The guidelines to posting code [webmasterworld.com] are pinned at the top of the forum.

IE6 often is the unwilling one out there, I guess we all feel the pain you're in.

BadBoyMcCoy

10:54 am on Oct 23, 2008 (gmt 0)

10+ Year Member



The problem with the transparent tabs could be because your not using the png fix properly. read up on how to implement it correctly, i had a similar problem with ie6 a little while ago, I was using the wrong filepaths, you have to link to the the transparent gif aswell as the .htc file. Double check your filepaths.

The spacing issue may be something to do with an ie bug where if you have an element floating left and you give it a left margin of say 20px, ie6 will double the margin. the fix for this is to put display inline as the last thing in the class. eg

.tab {
float:left;
margin-left:20px;
display:inline;
}

weird fix but it should work

as for the footer image i think we would need to look at your relevant css and html like swa66 says

CWitt

12:00 am on Oct 24, 2008 (gmt 0)

10+ Year Member



Thanks for the input. I had checked the guidelines before posting and noticed it said not to link, but you could post the site as example.com - my fault on that one. I'll post some code here in a bit, but I may have found a possible culprit to the spacing issue. It seems that my header image maybe pushing out the tabs. I'll have to experiment with a smaller header image.

Second, I think that I found out the issue with the footer. It seems that IE6 doesn't recognize the height of the header. What I found is that when I do something like:


<html>
<head>
<title>Document Title</title>
<style type="text/css">
body {
padding: 0;
margin-top: 10px;
width: 100%;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
font-size: 0.8em;
text-align: center;
line-height: 1.2em;
color: #333333;
background: #D8C981 url(images/main.bg.png) repeat-x top;
}
#footer {
padding: 0px;
margin: 0;
clear: both;
text-align: center;
background: url(http://www.example.com/footer.png) repeat-x;
}
</style>
</head>
<body>
<div id="footer" class="clear-block">
<br>Hello World<br><br>
</div>
</body>
</html>

It looks right. It seems like IE6 doesn't want to display the full footer. When I get rid of the breaks before and after Hello World, then it looks like it did originally. Perhaps I need to declare how big the footer is?

[edited by: swa66 at 12:05 am (utc) on Oct. 24, 2008]
[edit reason] URL in code examplified [/edit]

CWitt

12:44 am on Oct 24, 2008 (gmt 0)

10+ Year Member



So... NetRender is working right now, so I've been relying on my fiancee to tell me how it looks on IE6 (high-tech, I know). But it sounds like I sorted out the footer and header spacing issues.

Header Spacing:

Seems that the header image was a few pixels too tall, therefore pushing the tabs down creating some white space on IE6. My solution was to decrease the height of the image.

Footer:

IE6 didn't know what height I wanted the footer at, so I specified the height. This allowed the image to be displayed properly, but the spacing wasn't right. I added some padding to my #footer in ie6.css which seemed to have resolved the issue.

Tabs/Transperancy:

Trying to figure this one out. BadBoyMcCoy suggested I double check my filepaths on the PNGfix. I'm not actually too sure where to double check these files, but here's the code if you could give me a quick look.


(function(jQuery) {
jQuery.fn.pngFix = function() {
var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
if (jQuery.browser.msie && (ie55 ¦¦ ie6)) {
jQuery(this).find("img[@src$=.png]").each(function() {
var prevStyle = '';
var strNewHTML = '';
var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
if (this.style.border) {
prevStyle += 'border:'+this.style.border+';';
this.style.border = '';
}
if (this.style.padding) {
prevStyle += 'padding:'+this.style.padding+';';
this.style.padding = '';
}
if (this.style.margin) {
prevStyle += 'margin:'+this.style.margin+';';
this.style.margin = '';
}
var imgStyle = (this.style.cssText);
strNewHTML += '<span '+imgId+imgClass+imgTitle+imgAlt;
strNewHTML += 'style="position:relative; white-space:pre-line; display:inline-block; background:transparent;'+imgAlign+imgHand;
strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
strNewHTML += imgStyle+'"></span>';
if (prevStyle != ''){
strNewHTML = '<span style="position:relative; display:inline-block;'+prevStyle+imgHand+'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;'+'">' + strNewHTML + '</span>';
}
jQuery(this).hide();
jQuery(this).after(strNewHTML);
});
}
};
})(jQuery);

Any thoughts? And thanks again for helping me figure out my problems.

[edited by: CWitt at 12:45 am (utc) on Oct. 24, 2008]

[edited by: SuzyUK at 11:15 pm (utc) on Oct. 24, 2008]
[edit reason] fixing horizontal scroll [/edit]

swa66

9:38 am on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could probably try to add the "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" the javascript adds runtime in the conditional comment.

I try to use IE7.js (it fixes much more than just this), but it's got problems of its own as well.

CWitt

9:42 pm on Oct 24, 2008 (gmt 0)

10+ Year Member



Where can I add this code?

swa66

9:57 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IE7.js has its home at google code.
[code.google.com...]

CWitt

11:01 pm on Oct 24, 2008 (gmt 0)

10+ Year Member



Thanks! Do I understand this correctly... I have to change the name of the files to whateverfilename-trans.png and also change the CSS pointing to these files?

swa66

11:58 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's indeed my understanding as well

CWitt

10:20 pm on Oct 27, 2008 (gmt 0)

10+ Year Member



So here's my workaround. I tried to use the JS listed above, but it wasn't working 100% of the time - so I abandoned it. What I did is use the conditional [if lte IE 6] statement in my page, which I was already doing. Went into my IE6.css and modified the elements called by the CSS. I added new images that were PNG8 rather than PNG24, redirected all IE6 users to see those images. They ultimately get less quality in the image, but hey they are the ones choosing to use IE6.

Kind of a messy hack, but it seems to work well.