Luigi wrote:
David Dorward <do*****@yahoo.com> wrote in message news:<cv*******************@news.demon.co.uk>...
Luigi wrote:
I would to know what is the EXACT displacement between an outer box
and an inner box (placed with the "position:absolute" property and the
"top" and "left" values).
Assuming only the outer box is positioned, then normal flow applies, so its
whatever the margins and padding work out to.
Ok David, assuming the outer box has a relative position, where can I
find the upper-left corner of the inner box?
And what are the differences between IE and other browsers?
Thanks, Luigi.
Perhaps a basic condensed review of the box model to be found in the
specs is what you are looking for. All browsers respect the following:
There are four (4) different boxes:
Static
Relative
Absolute
Fixed
A 'Static' box does not take positioning relative to where it is in the
normal flow - it remains static in its normal flow.
A 'Relative' box is positioned relative to where it is in the normal
flow - Positioning is offset from the position it would have taken in
Static. (Taken out of normal flow, but real estate is maintained where
it would have normally been in normal flow.)
An 'absolute' box is positioned relative to the viewport (0,0 or
top/left of the screen), but if located within a containing block (i.e.
a relative box), it is positioned relative to the containing block
(essentially, the viewport for the abs box will then be the rel box)
therefore the top/left of the abs box will be the top/left of the rel
box. (Always out of flow.)
A 'fixed' box is always positioned relative to the top/left of the
viewport. (Always out of flow.)
--
Gus