W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: Inconsistent position:relative behaviour

From: Alan Gresley <alan@css-class.com>
Date: Sun, 13 Feb 2011 06:27:00 +1100
Message-ID: <4D56DF04.9020905@css-class.com>
To: Markus Ernst <derernst@gmx.ch>
CC: www-style@w3.org
On 13/02/2011 5:05 AM, Markus Ernst wrote:

> It is this sentence then:
> "The top margin of an in-flow block box is adjoining to its first
> in-flow block-level child's top margin if the element has no top
> border, no top padding, and the child has no clearance."
> I must admit I was not aware of what this means before. Is there any
> use case that makes margin collapsing between parent and child
> elements desirable?

Yes. When an element is not in normal flow and many more other cases 
that I could take weeks to articulate.



> I'd actually suggest to drop this. Making a margin of a child element
> affect the behaviour of the parent looks highly counterintuitive to
> me.

If this behavior was dropped, the web would be broken.

> My use case is a very common task: A footer that sticks at the
> viewport bottom if there's enough space, but always remains below the
> content area if there is more content. I set up a test page that
> illustrates how I'd expect to code this:
> http://www.markusernst.ch/stuff_for_the_world/css-position-test2.html

Add this.

#main { overflow: auto; padding-bottom: 1em; }

Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Saturday, 12 February 2011 19:28:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC