atom feed21 messages in org.w3.www-styleMixing percentage height and min-height
FromSent OnAttachments
Allan Sandfeld JensenOct 11, 2006 11:20 am 
Boris ZbarskyOct 11, 2006 1:39 pm 
Ian HicksonOct 11, 2006 4:43 pm 
Ian HicksonOct 11, 2006 4:47 pm 
Boris ZbarskyOct 11, 2006 5:00 pm 
Ian HicksonOct 11, 2006 5:21 pm 
Allan Sandfeld JensenOct 12, 2006 12:42 am 
Boris ZbarskyOct 12, 2006 7:41 am 
Boris ZbarskyOct 13, 2006 7:06 am 
Alastair CampbellOct 13, 2006 8:05 am 
Boris ZbarskyOct 13, 2006 8:11 am 
L. David BaronOct 13, 2006 8:26 am 
Allan Sandfeld JensenOct 13, 2006 9:16 am 
Boris ZbarskyOct 13, 2006 9:34 am 
Boris ZbarskyOct 13, 2006 9:46 am 
Ian HicksonOct 13, 2006 9:46 am 
L. David BaronOct 13, 2006 10:56 am 
L. David BaronOct 13, 2006 10:58 am 
L. David BaronOct 13, 2006 11:04 am 
Ian HicksonOct 13, 2006 11:14 am 
Jonathan WattOct 15, 2006 3:29 pm 
Subject:Mixing percentage height and min-height
From:Allan Sandfeld Jensen (kd@carewolf.com)
Date:Oct 11, 2006 11:20:21 am
List:org.w3.www-style

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.

The reason is because 'height' is not explicitly defined for the outer div, so the percentage in the inner is calculated to 'auto'.

CSS 2.1 #10.5: "<percentage> Specifies a percentage height. The percentage is calculated with respect to the height of the generated box's containing block. 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'. "

Does this mean a percentage height never is calculated from min-height or only when the containing block is constrained by the minimum height?

The result of the last rule is kinda odd as percentage height could suddenly be lost when more content is added to containing block.

-- The mentioned case is "easy" as you _could _define a min-height percentage to always be calculated from a min-height of a parent if height is auto, but if you have:

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

What is the effect on .child?

-- Repeat question for max-height.

`Allan