Problem with IE Position: Absolute

I have this code that works well in Firefox; but shoots right on Explorer. Is there something wrong with this code that I cannot see?

Your help is appreciated.

<div style="position: absolute; top: 170px"><a href="http://www.mysite.com"><img src="images/sponsor.png" /></a></div> 

I expect the image to display on top of the main header image, which works fine in Firefox but moves right in IE, causing the site to break. I don’t know why this is happening.

+7
source share
2 answers

Add left: 0px; , IE probably won't give it that default value:

 <div style="position: absolute; top: 170px; left: 0px;"> 
+16
source

I found out that IE will not recognize properties declared as:

 top:(space)20px; 

- therefore, if you have a space between : and 20px , IE ignores this property. Hope this helps someone.

0
source

All Articles