views:

384

answers:

1

Just today learned that one of my websites, TwitPeek.net, is not rendering properly in IE8 outside of "Compatibility Mode". The site works fine in IE7.

Upon some investigation, it appears that IE8 is refusing to apply the page stylesheets to the anchor and img tags that the page's javascript generates. Because of this, none of the script.aculo.us animations display properly, the images aren't set to a uniform size, and all margins are completely ignored.

Basically the page looks like crap.

This has to be an IE8 bug, but is there something I can do to work around it besides using the compatibility mode meta tag?

EDIT: Problem solved. IE8 wasn't processing the class attribute on the new DOMElement. Had to set className instead.

A: 

have you seen this in your source-code?

<body id="index;" >

i doubt it has anything to do w/IE8 and more to do w/your HTML...

EDIT I think your error is here:

#FeedList>div>a.item>img {    <------------
    border:0;    
    width:140px;
    height:140px;    
    -webkit-box-shadow:0px 2px 7px black; <--------
}

maybe try:

#FeedList div a.item img {
    border:0;    
    width:140px;
    height:140px;    
}

to see what it does... also, please post the generated HTML... you may be having problems with malformed HTML also.

PS: I also get the following JS error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6;
 SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; Zune 3.0; .NET CLR 
3.5.30729; .NET CLR 3.0.30618; Tablet PC 2.0)

Timestamp: Sat, 25 Jul 2009 04:13:00 UTC


Message: 'console' is undefined
Line: 21
Char: 41
Code: 0
URI: http://www.twitpeek.net/js/twitpeek.js
Jason
Agreed. The site and animations actually work fine for me in IE8.
Jason Berry
ps... you may also want to try jquery. it's way easier :)
Jason
ty, didn't notice that, but it's not related to the issue I'm having. Perhaps this is a Win7 IE8 issue then, since that's what I'm running on.
ChiperSoft
i do see what you mean... your images in ie7 look way better than in ie8.. that's interesting, but again i'm sure it has to do w/your CSS and not w/IE8
Jason
This is what I'm getting in IE8: http://twitpic.com/bj690This is what it should look like: http://twitpic.com/bj6ha
ChiperSoft
It's fairly straightforward CSS, and as you said it works in IE7. Also displays perfectly in Safari, Chrome, and three versions of Firefox.
ChiperSoft
IE doesn't support the `-webkit-box-shadow` attribute in CSS
Jason
Right, so it ignores it, that has nothing to do with what's going on here. Also, > is a perfectly valid CSS selector and is even supported by IE7. I removed it just to make sure, and there was no change.
ChiperSoft
Also, this is DOM created content, the HTML it generates is whatever IE's DOM generates. "new Element('a')" is prototype's wrapper for "document.createElement('a')"
ChiperSoft
i know that > is a valid css selector.. i'm just trying to troubleshoot for you. please post your images' generated HTML so i can perform some testing for you
Jason
hm.. well that may be your problem then... IE8's generated HTML isn't providing you with the right selectors, maybe, and therefore your CSS isn't getting applied. do you have the ability to add a class to your `img` tag so that you can possibly hook your CSS that way?
Jason
Found the problem. Apparently IE8 doesn't process the 'class' attribute on DOM elements. I had to set className in the code.
ChiperSoft
hope i helped you figure it out!
Jason