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

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

From: Anne van Kesteren <annevk@opera.com>
Date: Thu, 12 Feb 2009 23:48:48 +0100
To: "L. David Baron" <dbaron@dbaron.org>, www-style@w3.org
Message-ID: <op.uo9gbmcy64w2qv@annevk-t60.oslo.opera.com>

On Thu, 12 Feb 2009 22:06:46 +0100, L. David Baron <dbaron@dbaron.org>  
> On Thursday 2009-02-12 19:51 +0100, Anne van Kesteren wrote:
>> http://www.w3.org/TR/CSS21/visuren.html#position-props states that for a
>> relative positionined element the computed value of 'bottom' (which is
>> also the inherited value) is defined in
> I think we probably want the "Otherwise:" text  from the computed
> value line to apply to the non-auto relative positioning case.


> However, I wonder if all of these adjustments (except for what's in
> the "Otherwise:" text) should be adjustments to the used value
> rather than the computed value, so that they don't affect
> inheritance.  I'm willing to guess that might be more consistent
> with implementations.  (Do you have testcases?)


<!doctype html>
  div { border-top:1px solid }
  #a { margin-top:30px; height:100px }
  #b { position:relative; bottom:10%; height:100px }
  #c { position:relative; top:inherit }
<p>Should there be three thin lines below or one thick and one thin?</p>
<div id=a><div id=b><div id=c></div></div></div>

... does seem to confirm that.

If you change top to bottom you do get three lines. If you give top the  
supposed computed value of top on #b (-10%) you also get three lines. If  
you remove height on #b and change top to bottom you get a different  
result in Opera and Firefox because Opera resolves percentages to lengths.

Hope that helps.

Anne van Kesteren
Received on Thursday, 12 February 2009 22:49:40 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:24 UTC