Re: Mixing percentage height and min-height

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 UTC