- From: Thomas Davie <tom.davie@gmail.com>
- Date: Mon, 16 Mar 2009 15:48:22 +0100
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: Aryeh Gregor <Simetrical+w3c@gmail.com>, www-style@w3.org
On 16 Mar 2009, at 15:40, Tab Atkins Jr. wrote: > On Mon, Mar 16, 2009 at 9:28 AM, Thomas Davie <tom.davie@gmail.com> > wrote: >> Thanks, okay, I don't yet fully understand what's going on here >> then. I >> have an example which I expect to produce a table using divs (yes, >> I know, >> this is as bad as producing divs using tables, but it's a good >> example of >> trying to achieve a certain layout and apparently being stymied by >> css: >> >> http://www.cs.kent.ac.uk/people/rpg/tatd2/test.html >> >> I had assumed previously that absolute positioning was positioning >> elements >> relative to the top-left of the document window, causing the >> absolutely >> positioned elements to not be part of their parent div, and hence the >> relatively positioned ones to have a height of 0. Apparently >> though this is >> not what's happening. > > Absolute positioning removes an element from the document flow. This > means, among other things, that parent elements no longer use it to > determine their height; they no longer 'contain' the abspos element. > Thus, if you abspos all the children of an element, that element no > longer has *any* in-flow content, and collapses to 0 height. > > You're not seeing a contradiction, you're just seeing multiple effects > in play. Note that even in your example it's clear that the abspos > elements are positioning themselves based on their parent, as the > elements are offset from each other by several pixels, due to the > borders on the collapsed parents making their height non-zero. That sounds like a very strange contradiction indeed actually. The elements are positioned within their parent but are not in their parent. Is there a reason for this strange behavior? Incidentally, this returns me to my original question – there is no positioning mode which simply lays the elements out within their parent. Why not? Thanks Bob
Received on Monday, 16 March 2009 14:48:58 UTC