Jump to content


Photo

position absolute in IE8


  • Please log in to reply
5 replies to this topic

#1 1internet

1internet

    Advanced Member

  • Members
  • PipPipPip
  • 137 posts

Posted 22 March 2013 - 11:14 PM

I have an issue in IE8 where my div is displayed about 50px closer to the top than in FF or Chrome, or IE9. I think I have narrowed it down to it being the position absolute. I am declaring an HTML5 doctype, but still facing this issue. It also occurs for position: relative.

 

#slider {
	position: absolute;
	margin-left: 315px;
	margin-top: -350px;
	z-index: 1;
}

 

Any easy solution to get around this?



#2 haku

haku

    Advanced Member

  • Staff Alumni
  • 6,172 posts

Posted 23 March 2013 - 01:23 AM

Explicitly set 'top' (or 'bottom') and 'left' (or 'right')



#3 1internet

1internet

    Advanced Member

  • Members
  • PipPipPip
  • 137 posts

Posted 23 March 2013 - 01:39 AM

I tried that, but left won't work for different window sizes. How do I solve that?



#4 haku

haku

    Advanced Member

  • Staff Alumni
  • 6,172 posts

Posted 23 March 2013 - 02:40 AM

Not enough information to say.



#5 1internet

1internet

    Advanced Member

  • Members
  • PipPipPip
  • 137 posts

Posted 23 March 2013 - 03:37 AM

It works with top, do I really need left or right? Is vertical placement enough?



#6 haku

haku

    Advanced Member

  • Staff Alumni
  • 6,172 posts

Posted 23 March 2013 - 03:42 AM

Test cross-browser. If it is the same, you don't need it. If it's not, you do.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com