W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [CSS21] min-height: 100% in html, body

From: Philippe Wittenbergh <ph.wittenbergh@l-c-n.com>
Date: Fri, 27 Jan 2012 13:48:33 +0900
Cc: "Lea Verou" <leaverou@gmail.com>, "W3C www-style mailing list" <www-style@w3.org>
Message-Id: <1AD82820-59AB-4D13-A4B5-C3C083BC444F@l-c-n.com>
To: www-style@gtalbot.org

On Jan 27, 2012, at 12:43 PM, Gérard Talbot wrote:

> …

>  html
>  {
>  height: auto;
>  min-height: 100%;
>  }
> is not resolvable; as I am trying to understand your point of view,
> Philippe, this is what you're basically saying.

Well browsers resolve that as being the height of the viewport.

html {
	min-height: 100%;
	border-left: 50px solid green;
}

You'll see a border on the left from top to bottom of the viewport.

> ...
> Since 'height: auto' is not resolvable, then such comparison is also not
> doable. Okay, Philippe: I see your point.

My point is that, given
html, body {
	min-height: 100%;
}

the min-height on body computes to '0', as the height of the parent block cannot be resolved. Indeed.

> On the other hand,
> html {height: 100%;} is.
> 
> So, this leaves me with at least 4 tests with predictable layout.
> 
> The following 4 tests are correct, should be correct:

Test 1 and 2 are correct (and browsers handle that as expected: lime background).

> 3-
> 'height: 100%' set on html, 'min-height: 100%' set on body, 'height: 100%'
> set on p (h, m, h):
> 
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/min-height-percentage-005.xhtml

This should fail. This is similar to Lea's initial test case. The height of body is 'auto', 'height: 100%' on the child <p> is auto. CSS 2.1:10.5 again.

> 4-
> 'height: 100%' set on html, 'min-height: 100%' set on body, 'min-height:
> 100%' set on p (h, m, m):
> 
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/min-height-percentage-004.xhtml

This should fail for the same reason as the third test case.



Philippe
--
Philippe Wittenbergh
http://l-c-n.com/
Received on Friday, 27 January 2012 04:49:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:49 GMT