PDA

View Full Version : DIV layer problem


vorl
09-29-2005, 01:20 AM
Hi

I am having a problem with a div layer.

<div id="Main" style="position:absolute; left:121px; top:215px; width:155px; height:200px; z-index:1">test</div>

The layer is perfectly placed in the browser when the browser is maximised. Whenever I reduce the width of the browser by adjusting it or making the favourites bar appear (in IE) the layer moves right and out of place.

Is there a way to stop this moving?

Thanks :)

vorl

mark87
09-29-2005, 10:36 AM
Yes there is a way to stop it, and it's called "don't use absolute positioning!".

Use relative positioning. :)

ronaldb66
09-29-2005, 12:44 PM
It can also be solved while being absolute positioned, but you really need to give more insight in the rest of the page.

Elements can be absolute positioned in respect of a positioned parent element, making its position dependent on that of the parent instead of the document -like I suspect it is now.

Again: we need to see the markup (and styles, if there are any).