On Feb 23, 2007, at 8:51 PM, Lee Powell wrote: > http://sixtyten.co.uk/test.html > > Basically, it's a <div> nested inside a container <div>. I've set a > height and width for the container div in %, and then applied a > similar format to the nested div... this has all worked fine. However > the problem comes when I set a top-margin of 50% to the nested div. > > Theoretically I would have thought the nested div would have though > calculated the 50% from it's parent, however that doesn't seem to be > the case and looks as though it's getting it from the body.
From CSS 2.1, 8.3 Margins > <percentage> > The percentage is calculated with respect to the width of the > generated box's containing block. Note that this is true for > 'margin-top' and 'margin-bottom' as well. If the containing block's > width depends on this element, then the resulting layout is > undefined in CSS 2.1. <http://www.w3.org/TR/CSS21/box.html#propdef-margin> 'with respect to the width' is key here. Resize you window horizontal to see what happens (using a decent browser, that is. IE sometimes does crazy things with % margins). Philippe --- Philippe Wittenbergh <http://emps.l-c-n.com> ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
