Re: Mixing percentage height and min-height

On Friday 2006-10-13 10:56 -0700, L. David Baron wrote:
> On Friday 2006-10-13 16:47 +0000, Ian Hickson wrote:
> > 
> > On Fri, 13 Oct 2006, Boris Zbarsky wrote:
> > > 
> > > What if I have:
> > > 
> > >  .parent { height: 20px; min-height: 100px; }
> > >  .child { height: 50% }
> > > 
> > > and the same markup?  Should the child end up 10px tall?  Or 50px tall?
> > 
> > 50px; the height is based on the height of the containing block which in 
> > this case is 100px.
> 
> It's nowhere near that obvious, since 10.5 says [1]:
> 
> # <percentage>
> #   [...] If the height of the containing block is not specified
> #   explicitly (i.e., it depends on content height), and this
> #   element is not absolutely positioned, the value computes to
> #   'auto'.
> 
> The height of the containing block *does* in this case depend on the
> content height -- if the content had been taller than 100px, it
> would expand.

Er, sorry, I should look more closely at which testcase you're
quoting.

I suppose that is supported by the spec as currently written, so the
change I proposed in
http://lists.w3.org/Archives/Public/www-style/2006Oct/0087 is not
actually needed.

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Received on Friday, 13 October 2006 17:58:47 UTC