mlmorg
05-04-2010, 09:27 PM
Hi all,
It's been a long time since I've posted but I've got an interesting issue going on that I can't seem to understand. I've got a container that has position:relative. Within that I've put an absolutely positioned box and set a negative bottom and right on it so that it sits just outside the bottom right of the container. Unfortunately, in all browsers I have found that the inner box is registered as part of the flow and scrollbars will initiate at the point of the box -- and not at the point of the container element.
I'm attaching a photo of what I'm talking about but if you'd like to test it yourself, here's the code:
<style type="text/css" media="screen">
#container {
width:960px;
height:500px;
position:relative;
background:#000;
}
#box {
width:400px;
height:400px;
position:absolute;
bottom:-200px;
right:-200px;
background:#eee;
}
</style>
<div id="container">
<div id="box"></div>
</div>
Has anyone come across something like this? Is there any way around it? It's pretty necessary for me to be able to have something absolutely positioned to the bottom left of a container without it disrupting the flow...
Thanks for any help ya'll can give me!
It's been a long time since I've posted but I've got an interesting issue going on that I can't seem to understand. I've got a container that has position:relative. Within that I've put an absolutely positioned box and set a negative bottom and right on it so that it sits just outside the bottom right of the container. Unfortunately, in all browsers I have found that the inner box is registered as part of the flow and scrollbars will initiate at the point of the box -- and not at the point of the container element.
I'm attaching a photo of what I'm talking about but if you'd like to test it yourself, here's the code:
<style type="text/css" media="screen">
#container {
width:960px;
height:500px;
position:relative;
background:#000;
}
#box {
width:400px;
height:400px;
position:absolute;
bottom:-200px;
right:-200px;
background:#eee;
}
</style>
<div id="container">
<div id="box"></div>
</div>
Has anyone come across something like this? Is there any way around it? It's pretty necessary for me to be able to have something absolutely positioned to the bottom left of a container without it disrupting the flow...
Thanks for any help ya'll can give me!