Log in

View Full Version : Resolved apDivs that were working - now won't stay put!



susaninphoenix
03-23-2009, 06:14 PM
UPDATE : Since I posted the Messed up version - whatever did this is now doing it to the whole previously posted site - I overwrote something I shouldn't have - Help!!?*@

I designed using apDivs to give me some flexibility and I plan to get rid of most of them once the design is settled down.

In the meantime, something I've done has got them where they won't stay in their place when the browser window gets wider than the outer wrapper.

I'm going nuts trying to see the difference between the pages that were working fine and the messed up version which was the result of trying to place some nested divs into the layout, so I could replace the apDivs.

Now, all the original files on my local drive, from before I started trying to nest the Divs on just one of the files, are all behaving like this.

Take a look if you think you can help...

Before:
http://www.kdpools.net/new/Rectangle.html

After:
http://www.kdpools.net/new/RectangleMessedUp.html

Sure do appreciate any advice.


Thanks,
Susan

Snookerman
03-23-2009, 06:30 PM
Add this to your CSS code:

#wrapper {
background-color:#FFFFFF;
margin-left:auto;
margin-right:auto;
width:816px;
position: relative;
}
Absolutely positioned elements will position themselves inside the first parent element that has a specified position, in your case the body element. By specifying a position for the wrapper, the absolutely positioned elements inside it will position themselves inside the wrapper container instead and will not be affected when the browser window is resized.

Good luck!

susaninphoenix
03-23-2009, 07:17 PM
Snookerman,
As usual, you saved the day! ...without ridiculing my imperfect code.

I love how your advice is so concise and directly to the point.


Thanks so much!!

Snookerman
03-23-2009, 08:39 PM
You're welcome Susan, I'm always happy to help!

Good luck with the site!