Roger Roelofs wrote: > On Jan 27, 2006, at 5:17 AM, Guillaume wrote: > > >> I have two divs: first comes A and then B, both with unknown height. >> B is pushed up, positioned above A in the layout, using position: >> absolute; top: 0. >> Is there a css-way to retrieve a stack order, to place A just under B >> without specifying any margin-top value for A and this way avoiding >> overlap ? >> > > No. Absolutely positioned elements take no space in the document > 'flow' and cannot influence other elements. However, if Bs content is > the same on all pages but you want the height to change depending on > the user's font-size preferences, you can set its height in em and set > As top margin to match. > > Obviously the simple solution is to reverse the source order, but I'm > assuming you are trying to avoid that. If you can live with a 90% > solution, you could rearrange the document source order when the page > loads with javascript... >
If you're more than a beginner with CSS, another solution is to use negative margins to preserve source order while still achieving the visual layout you want. It's kind of tricky, so I wouldn't recommend newbies take on such an exercise, but I've used negative margin layouts on a few different sites without issue. http://www.communitymx.com/abstract.cfm?cid=B0029 http://www.alistapart.com/articles/negativemargins/ http://www.communitymx.com/abstract.cfm?cid=E9A76 http://www.communitymx.com/abstract.cfm?cid=CE08C http://www.communitymx.com/abstract.cfm?cid=BB650 Zoe -- Zoe M. Gillenwater Design Services Manager UNC Highway Safety Research Center http://www.hsrc.unc.edu ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
