Proposal: easy attribute to uncollapse margins

Hi people responsible for CSS,

Sometimes collapsed margins are undesirable on elements with no
borders and padding, e.g. for the body element if you want to do exact
height calculations (for example to have its minimum height match the
viewport height) without the first child or last child's margins
throwing your calculations off.


The internet has come with nightmare'ish hacks to work around this:

http://stackoverflow.com/questions/15007322/clear-fix-and-uncollapse-margins-with-css-without-side-effects

http://stackoverflow.com/questions/6204670/css-clean-solution-to-the-margin-collapse-issue-when-floating-an-element

The shortest and most readable solution I have found is still this
one: margin: -1px 0 0 0; border-top: 1px solid;


However, this is still a hack. The obvious question is: can't you add
a simple uncollapse-margin:uncollapse; style property or something
along the lines to the CSS specs?

Sorry if this is already in the specs, but I couldn't find something
along the lines on the internet and I'm not a regular CSS proposal
person, so I don't know all of the specs in full detail. Also sorry if
this mail has gone to the entirely wrong place, this seemed like the
correct list to mail this to.

Regards,
Jonas Thiem

Received on Monday, 20 October 2014 20:36:25 UTC