View Full Version : IE Positioning is way off.
zro@rtv
05-05-2007, 01:21 AM
Hey.
Sorry for the stupid question, but i've been staring at this for a day, and cant seem to narrow it down. Its probably something easy, I'm just over looking.
http://gigi.digicog.com/
In internet explorer the content in #primary is like shifted down 200px and right 500px or something?
I have NO idea whats up with that.
I am using some absolute positioning in there, much to my dismay, but its minimal and shouldn't be effecting that div to my understanding.
Any ideas?
...p.s. I HATE IE!
_Aerospace_Eng_
05-05-2007, 01:50 AM
Set a width to secondary and float it to the right as well or don't set a width and give it a right margin equal to the width of #primary or greater than.
zro@rtv
05-05-2007, 05:00 AM
I'm pretty sure i tried both of those.
I gotta leave work right now though, so I can't post proof right this sec.
I didn't think either one worked.
thanks fr chekin it, though.
zro@rtv
05-06-2007, 11:52 PM
Here it is with #secondary floated and defined width:
http://gigi.digicog.com/
absolute insanity, as IE just loses #primary and #content when this is done.
and here it is with margin-right on #secondary:
http://gigi.digicog.com/index-margin.htm
I obviously am doing something wrong here but I cannot for the life of me put my finger on it. Any help/suggestions, much appreciated.
zro@rtv
05-07-2007, 12:26 AM
...god I HATE IE!
but anyway.
I solved this by moving my position:relative; declaration off of my #content div and on my lower nested #primary div.
No exactly sure why this has to bee, I assume it has something to do with IE and that wretched hasLayout stuff and the way it treats floats or something.
If anyone has any insight, I'd love some explanation for why this works now.
can bee seen @ link in first post.
koyama
05-08-2007, 10:57 PM
I solved this by moving my position:relative; declaration off of my #content div and on my lower nested #primary div.
No exactly sure why this has to bee, I assume it has something to do with IE and that wretched hasLayout stuff and the way it treats floats or something.
If anyone has any insight, I'd love some explanation for why this works now.
One should use position: relative only when necessary because this opens the door to so many IE bugs. This is still true as of version 7 although the situation has got better.
The problem was the following sequence of nested divs. From outer to inner:
div without layout having position: relative
div that hasLayout having position: static
div with position: relative with or without hasLayout
You may try the following example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>IE6 - div with position: relative inside div with layout inside div with position relative </title>
<style type="text/css">
body {
font-family: Arial, sans-serif;
}
#wrap {
position: relative;
background: green;
/* zoom: 1; */
}
#one {
width: 50%;
background: blue;
margin-left: 50px;
}
#two {
position: relative;
background: orange;
width: 50%;
}
</style>
</head>
<body>
IE6 is weird<br>IE6 is weird<br>IE6 is weird<br>IE6 is weird<br>IE6 is weird<br>IE6 is weird<br>IE6 is weird<br>IE6 is weird<br>
<div id="wrap">What is going on?<br>What is going on?<br>What is going on?<br>What is going on?<br>What is going on?<br>What is going on?<br>What is going on?<br>What is going on?<br>What is going on?<br>What is going on?<br>
<div id="one">
<div id="two">
<ul>
<li>1) Green div is relatively positioned and does not have layout</li>
<li>2) Blue div has layout while having position: static</li>
<li>3) Orange div is relatively positioned (not important whether it has layout or not)</li>
</ul>
Initially, when page loads in IE6 the yellow div is positioned outside the blue box and has drifted upwards to the top of the green box.<br>
When page is resized, the yellow box falls in place, but there may be flickering where the orange div disappears/reappears
</div>
</div>
</div>
</div>
</body>
</html>
I haven't yet found a source detailing the problem. If someone finds such a source I would like to know.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.