Re: Relative positioning

> 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).
> 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.

Received on Friday, 4 February 2000 08:45:13 UTC