Re: [css21] computed value of top/bottom for relative positioning

Giovanni Campagna wrote:
 > 2009/2/12 Anne van Kesteren <annevk@opera.com>
 >
 >> Given the following tree:
 >>
 >>  G
 >>    P
 >>      C
 >>
 >> ... with the following styles:
 >>
 >>  G { height:100px }
 >>  P { position:relative; bottom:25%; height:0 }
 >>  C { position:relative; bottom:inherit }
 >
> You need to flow the document in order to find width of G, so to transform
> 25% into 25px in P. Because computed values are found before used values,
> the computed value of bottom in P is 25% and so the specified and computed
> values in C, that lead to the used value of 0px

Is the width of G relevant here?  It may be that you're mistakenly 
thinking that percentage values for 'bottom' and 'top' are relative to 
the parent's width rather than the parent's height, as is the case for 
margin-bottom and margin-top.

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Thursday, 12 February 2009 20:37:58 UTC