W3C home > Mailing lists > Public > www-style@w3.org > September 2001

Containing block for Abs Pos elements

From: ValerieGSharp <ValerieGSharp@netscapeonline.co.uk>
Date: Mon, 03 Sep 2001 16:27:37 +0100
Message-ID: <3B93A169.C98FD456@netscapeonline.co.uk>
To: "www-style@w3.org" <www-style@w3.org>
There appears to be a contradiction regarding which edge, padding or
content, forms the containing block for an Absolutely Positioned element
with 'auto' offset(s).

According to CSS2 10.1 Definition of "containing block" [1]:

   "2. For other elements, unless the element is absolutely
       positioned, the containing block is formed by the content
       edge of the nearest block-level ancestor box."


   "4. If the element has 'position: absolute', the containing
       block is established by the nearest ancestor with a
       'position' other than 'static', in the following way:

        1. In the case that the ancestor is block-level, the
           containing block is formed by the padding edge of
           the ancestor."

However, when calculating, e.g., the height of an Abs. Pos. non-replaced
element, CSS2 10.6.4 Absolutely positioned, non-replaced elements [2]

    "If all three of 'top', 'height', and 'bottom' are auto,
     treat 'top' like 'static-position' and apply rule number
     three below."

And CSS2 9.3.2 Box Offsets... [3] says of 'static-position':

    "For 'top' use the distance from the top edge of the
     containing block to the top margin edge of a hypothetical
     box that would have been the first box of the element if
     its 'position' property had been 'static'."

But the containing block for an element with position:static is formed
by the *content* edge of the ancestor, not the padding edge.

So, for an Abs. Pos. element with offsets 'auto', should the containing
block be formed by the padding or the content edge?

Refs (incorporating errata

[2] <http://www.w3.org/TR/REC-CSS2/visudet.html#abs-non-replaced-height>
[3] <http://www.w3.org/TR/REC-CSS2/visuren.html#position-props>

Val Sharp - Edinburgh
Received on Monday, 3 September 2001 13:11:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:59 UTC