Stefan Bach: Interpretieren die Browser position: absolute falsch?

Hallo,

Ich bin mir nicht so ganz sicher, ob ich etwas nur falsch verstehe, oder ob die Browser position: absolute falsch interpretieren.

In den Specs steht folgendes:

absolute
    The box's position (and possibly size) is specified with the
    'left', 'right', 'top', and 'bottom' properties. These properties
    specify offsets with respect to the box's containing block.
    Absolutely positioned boxes are taken out of the normal flow.
    This means they have no impact on the layout of later siblings.
    Also, though absolutely positioned boxes have margins, they do
    not collapse with any other margins.

Es heißt, dass die Angaben für left, right, top und bottom relativ zum einschließenden Block einer Box sind.

Zu "containing block" steht folgendes geschrieben:

In general, generated boxes act as containing blocks for
    descendant boxes; we say that a box "establishes" the containing
    block for its descendants.

Wenn ich jetzt beispielsweise einen paragraph in einer Tabellenzelle mit der Eigenschaft position: absolute versehe, dann müsste der <td> Block ja der containing block für den <p> sein.

Die top Eigenschaft ist folgendermaßen beschrieben:

This property specifies how far a box's top content edge is
    offset below the top edge of the box's containing block.

Eine Eigenschaft von top: 10px müsste also bedeuten, dass die obere Ecke des <p> sich 10 Pixel unter der oberen Ecke des <td> befindet. Wenn ich für eine absolut Positionierte Box allerdings einen top oder left Wert angebe, so wird dieser immer relativ zum gesamten Dokument gesehen.

Liegt nun der Browser falsch oder habe ich hier einen Denkfehler?

Viele Grüße,

Stefan

  1. Hi,

    Abschnitt 9.8.4:

    The containing block for a positioned box is established by the nearest positioned ancestor (or, if none exists, the initial containing block, as in our example).

    Ist Deine td denn positioniert?

    cu,
    Andreas

    --
    Der Optimist: Das Glas  ist halbvoll.  - Der Pessimist: Das Glas ist halbleer. - Der Ingenieur: Das Glas ist doppelt so groß wie nötig.
    http://mud-guard.de/? http://www.andreas-waechter.de/ http://www.helpers.de/
    1. Hallo Andreas,

      Abschnitt 9.8.4:

      The containing block for a positioned box is established by the nearest positioned ancestor (or, if none exists, the initial containing block, as in our example).

      Vielen Dank, über diesen Satz bin ich irgendwie nicht gestolpert. Es wäre jetzt nur noch schön, wenn der IE sich zum bestimmen der Höhe eines Elements auch an die Rechnung aus der Spezifikation halten würde. Aber das mit top: 0 und bottom: 0 bekommt der ja nicht hin.

      Nun ja, war eh nur eine theoretische Überlegung, um die es ging.

      Viele Grüße,

      Stefan