views:

303

answers:

2

I am creating a banner that resizes to fit the window (I got the code of a blog post) and it works fine in Firefox, but it doesn't display at all in IE8. Please help!!

<html>
<body>

<div style=”position:relative; width:100%; height:100%; margin:0px; padding:0px; left:0px;right:0px;z-index:1”><img src="https://na6.salesforce.com/servlet/servlet.ImageServer?id=01580000000pT8r&amp;oid=00D80000000aYeL&amp;lastMod=1273785188000" width=”100%”></div>
<div style=”z-index:2; position:relative; margin:0px; padding:0px;”>
</div>

</body>
</html>
+2  A: 

You've not closed the img tag. It should be as follows:

<img src="https://na6.salesforce.com/servlet/servlet.ImageServer?id=01580000000pT8r&amp;oid=00D80000000aYeL&amp;lastMod=1273785188000" width=”100%” />

I'm guessing this is what's causing the problem. Maybe Firefox is a bit more clever than IE8 at recovering from bad markup.

EDIT:

Baloo's answer baffled me at first because I couldn't see what changes he'd suggested, but it appears another user had edited the question and removed those alternative char set speech characters.

GenericTypeTea
I closed the img tag just like you showed, but it didn't fix it. I saw on another forum something about height = 100% having trouble in IE, could that be the problem?
Nathan Spiwak
A: 

Replace the utf-8 ” with latin1 "

<html>
<body>

<div style="position:relative; width:100%; height:100%; margin:0px; padding:0px; left:0px;right:0px;z-index:1"><img src="https://na6.salesforce.com/servlet/servlet.ImageServer?id=01580000000pT8r&amp;oid=00D80000000aYeL&amp;lastMod=1273785188000" width="100%"></div>
<div style="z-index:2; position:relative; margin:0px; padding:0px;">
</div>

</body>
</html>

Or rather, make sure you save it in the corrent encoding, IE8 plays nice over here

baloo
In notepad, I didn't find the option to save it as latin1. Just ANSI, Unicode, or Uft-8.
Nathan Spiwak
He's saying use " instead of ”. Try it.
GenericTypeTea
It worked!!! I had no idea there were more than one type of quotation mark. I copied and pasted his code and it worked fine in both IE and Firefox. I also added the "/" to close the img tag just to be safe. Thanks guys!
Nathan Spiwak