Re: Relative positioning

Matthew Brealey wrote:
> 
> > Relative positioning
> >
> > From: firespring (firespring@nfx.net)
> 
> > At the risk of being chastised for what might be perceived as a "how to"
> > question, what I'm wondering is if there is any mechanism in CSS for
> > positioning one element box relative to an absolutely positioned box
> > of another element?
> >
> > I mean, with absolute positioning, elements are positioned completely
> > independently as if they have no knowledge of each other, and with
> > relative positioning, elements are positioned only relative to the
> > normal flow. This effectively means that the two types of positioning
> > can't really be used together very well, and what seems to be missing is
> > a mechanism for positioning one element relative to an absolutely positioned
> > (and perhaps named) element, thereby avoiding potential overlap problems.

> Something like this is often useful:
> CONTAINER {position: relative}
> INSIDE {position: absolute}
> 
> The position: relative on the CONTAINER establishes a new containing
> block for the absolutely positiond element without affecting the
> CONTAINER; the reference point is the padding edge of the containing
> block (not, sadly, the content edge).

I thank you for the suggestion Matthew, but it doesn't work in practice
because NS 4.7 doesn't handle it properly. If you look at my page:

http://www.firespring.com/cat1a.html

you'll see that it works when I use only a background color (ignoring the
other NS problem this block has with justified text.) However, if I use 
a background-image instead of just a background color as in my next page:

http://www.firespring.com/cat1b.html

you'll see that the block entirely disappears. I'll admit that I haven't
tried fixing it with a z-index yet, but then again, I don't think that
should be neccessary.


> > If such a mechanism existed, it would sure make it easier to create
> > frame-like pages without resorting to (yecchh) tables.
> If you want FRAMESET-like pages, use position: fixed; if you want
> TABLE-like pages, use floats.

If position:fixed worked, I would certainly try it. The last time
I checked, it was not reliably implemented by even the big two UAs.

Rick Johnson
firespring@nfx.net

Received on Sunday, 6 February 2000 14:24:41 UTC