circusbred
10-06-2004, 06:09 PM
I have noticed some very odd Safari behaivor. Usually, when you have a parent element with position:relative and a child position:absolute The child element will align itself to the parent element. However, I have run into a bit of an issue.
It happens when I have another element, a relative positioned float left next to the element in question.
#main {
position:relative;
width:785px;
margin:35px auto;
}
#cont {
position:relative;
width:564px;
padding:0 10px;
margin:0 auto;
}
#subnav {
position:relative;
width:138px;
padding:0 5px;
margin-right:50px;
float:left;
}
#subnav .top, #cont .top {
position:absolute;
top:-21px;
left:0px;
}
#subnav .bottom, #cont .bottom {
position:absolute;
bottom:-21px;
left:0px;
}
<div id="main">
<div id="subnav">
<img src="img/sn-top.jpg" class="top" />
Subnav.
<img src="img/sn-bot.jpg" class="bottom" />
</div>
<div id="cont">
<img src="img/top.jpg" class="top" />
Content. The two images are incorrectly positioned ONTOP of #subnav.
<img src="img/sn-bot.jpg" class="bottom" />
</div>
</div>
Anyone know of a possible solution, or cause of this problem?
CSS/ HTML simplified for example. Actual page you can see this problem:
http://www.camdenrose.com/catalog/
Thanks Much.
Using Safari v85 (1.0) for MAC OS 10.2.8
It happens when I have another element, a relative positioned float left next to the element in question.
#main {
position:relative;
width:785px;
margin:35px auto;
}
#cont {
position:relative;
width:564px;
padding:0 10px;
margin:0 auto;
}
#subnav {
position:relative;
width:138px;
padding:0 5px;
margin-right:50px;
float:left;
}
#subnav .top, #cont .top {
position:absolute;
top:-21px;
left:0px;
}
#subnav .bottom, #cont .bottom {
position:absolute;
bottom:-21px;
left:0px;
}
<div id="main">
<div id="subnav">
<img src="img/sn-top.jpg" class="top" />
Subnav.
<img src="img/sn-bot.jpg" class="bottom" />
</div>
<div id="cont">
<img src="img/top.jpg" class="top" />
Content. The two images are incorrectly positioned ONTOP of #subnav.
<img src="img/sn-bot.jpg" class="bottom" />
</div>
</div>
Anyone know of a possible solution, or cause of this problem?
CSS/ HTML simplified for example. Actual page you can see this problem:
http://www.camdenrose.com/catalog/
Thanks Much.
Using Safari v85 (1.0) for MAC OS 10.2.8