W3C home > Mailing lists > Public > www-style@w3.org > October 2006

Re: Mixing percentage height and min-height

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 11 Oct 2006 23:44:12 +0000 (UTC)
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: Allan Sandfeld Jensen <kde@carewolf.com>, www-style@w3.org
Message-ID: <Pine.LNX.4.62.0610112341110.18283@dhalsim.dreamhost.com>

On Wed, 11 Oct 2006, Boris Zbarsky wrote:
> > 
> > but if you have:
> > 
> > .parent { min-height: 100px }
> > .child { height: 50% }
> > 
> > What is the effect on .child?
> 
> The way I'd always read the spec part I quoted above in this scenario is:
> 
> 1)  Apply section 10.6.3 to the parent with "height: auto" for the
>     parent.
> 2)  Apply section 10.6.3 to the child.  End up with a computed height
>     of "auto" for the child.
> 3)  Determine the resulting child's height and hence parent's height.
> 4)  If the resulting parent's height is >= 100px, we are done.
> 5)  Otherwise, apply section 10.6.3 to the parent with a computed height
>     of "100px" for the parent.

Used height, not computed height.

> 6)  Apply section 10.6.3 to the child.  End up with a computed height
>     of "50px" for the child.  Done.

No, the height of the containing block is not specified explicitly (i.e., 
it depends on content height), and the element in question is not 
absolutely positioned, so the value computes to 'auto', regardless of 
min-height and max-height.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 11 October 2006 23:44:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:47 GMT