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

Re: Mixing percentage height and min-height

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Fri, 13 Oct 2006 09:06:38 -0500
Message-ID: <452F9D6E.4020301@mit.edu>
To: www-style@w3.org

One more question about percentage heights and min-height.  So if I have:

  .parent { min-height: 100px; }
  .child { height: 50% }

and

   <div class="parent"><div class="child"/></div>

then the child's computed height will be "auto" and the child will end up 0px 
tall while the parent ends up 100px tall, right?  That seems to be the 
conclusion of the preceding discussion.

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?  Or 0px 
tall?  Note that in this case the parent's height in fact does not depend on the 
  children, so I would think that it should be either 10px or 50px.  But I'm not 
sure which one of those it should be...

-Boris
Received on Friday, 13 October 2006 14:06:52 GMT

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