Control over collapsing margins

Hi all,

I was reading up on collapsing margins as they've been causing me quite some trouble. Whenever a child element has a different background styling from its parent, collapsing margins are usually troublesome. The collapse is broken by padding and borders, but not by different style of background (which also indicates separation).

Rather than change the rules for collapsing, I wonder if it wouldn't be better to give css people the opportunity to manage them themselves if needed. In short, introduce a new property which can break the collapse when needed, because adding unneeded borders, paddings or overflows is really not the way to go.

Further explanations of my view can be found in the following article:
http://www.onderhond.com/blog/work/collapsing-margins-improvement


I apologize if this issue was already raised, but couldn't find any information about it.

Greets,
Niels Matthijs


-----Original Message-----
From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf Of Simon Pieters
Sent: 22 April 2009 09:52
To: fantasai
Cc: Grant, Melinda; www-style@w3.org; www-svg@w3.org
Subject: Re: 'image-fit' vs preserveAspectRatio

On Tue, 21 Apr 2009 20:51:29 +0200, fantasai <fantasai.lists@inkedblade.net> wrote:

> Erik Dahlström wrote:
>>
>>>> Previously, the CSS spec had the same keywords as SVG. What's
>>>> the reason for the change?
...
> Actually, the original name in the CSS draft was copied from SMIL
> and was 'fit', not 'preserveAspectRatio'.

But the *keywords* were fill | hidden | meet | slice, where meet and slice are the same as in SVG.

-- 
Simon Pieters
Opera Software

Received on Wednesday, 22 April 2009 10:31:18 UTC