W3C home > Mailing lists > Public > www-style@w3.org > June 2007

[CSS21] Margin-Collapse Property to fix inconsistency

From: Nicholas Retallack <nickretallack@gmail.com>
Date: Sat, 16 Jun 2007 21:41:40 -0700
Message-ID: <66e809970706162141l6f989cf9hfb8c6e09e0f36542@mail.gmail.com>
To: www-style@w3.org

Margin collapsing has an inconsistency I've never really seen the
reasoning behind-- it only works vertically not horizontally, which
seems an arbitrary decision, and also it can't be turned off.  I would
like to suggest that margin collapsing be something we have control
over and can disable.  The property could look something like this:

margin-collapse: vertical | horizontal | both/all | none

Horizontal margin collapse would go well with horizontal shrinkwrap
styles like display:table-cell/list-item and float.  You could also
make a gallery of equally-spaced floating thumbnails or boxes and only
have to specify one margin (margin: 4px) instead of having to halve it
in the horizontal direction since those margins don't collapse
(margin: 4px 2px).

For extra coolness, have it support top, bottom, left, and right in
there as well, combinatorily, so a user could do this to create a
gallery of tiles of content, eliminating extra margin space on the
right and bottom as it grows and floats:

..tile { margin-collapse: top left; margin: 1em 0 0 1em; float:left }

Also I'm quite sure many users would be very happy to do this:

* { margin-collapse: none }
Received on Monday, 18 June 2007 00:31:53 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:29 UTC