hi, I'm trying to display a close button (an "X", id="closeDiv" in the code below) that always stays in the same position within its parent, the associated popup box. I can adjust the initial position of the "X" to where I want it, but when I change the size of the browser window, the "X" floats relative to the popup box. I've set the closeDiv to position:relative and then a bottom:5px. My understanding is that it should then always position itself 5px from the bottom of its parent. But that's not what I see, as I said it floats around. Appreciate any help. Thanks
Yes. 'relative' positions the box relative to where it would have been hadn't it been positioned. 'absolute' positions it relative its containing block. What the containing block is may vary depending on context and is a little tricky to get your head around, but in your case it clearly is the containing DIV since that is positioned.
http://www.w3.org/TR/CSS2/visuren.html#propdef-position
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)