W3C home > Mailing lists > Public > www-style@w3.org > February 2009

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

From: Anton Prowse <prowse@moonhenge.net>
Date: Thu, 12 Feb 2009 21:37:11 +0100
Message-ID: <49948877.9020500@moonhenge.net>
To: www-style@w3.org

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:16 GMT