Re: Mixing percentage height and min-height

On Thursday 12 October 2006 01:47, Ian Hickson wrote:
> On Wed, 11 Oct 2006, Allan Sandfeld Jensen wrote:
> > Just got an interesting "bug" in KDE bugzilla.
> >
> > You have:
> >
> > div { min-height: 100% }
> >
> > and two nested divs
> > <body>
> > <div><div> </div></div>
> > </body>
> >
> > The result is that inner div is not 100% of body.
>
> In the case given above, since the <body> does not have an explicit
> height, 'min-height: 100%' on its <div> child is exactly equivalent to
> 'min-height: 0'.
>

One of the solutions I considered for something like this (because it is 
un-intuitive right now) was to let percentages of min-height and max-height 
be calculated from min-height or max-height of the containing block if height 
is auto. So height is never calculated from min-max but min-max  are. 

So:

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

Would calculate to .child { min-height: 50px; height: auto }


`Allan

Received on Thursday, 12 October 2006 07:43:42 UTC