W3C home > Mailing lists > Public > www-style@w3.org > November 1998

Re: Colors of collapsed margins

From: Ian Hickson <py8ieh@bath.ac.uk>
Date: Thu, 19 Nov 1998 23:09:37 +0000 (GMT)
To: "L. David Baron" <dbaron@fas.harvard.edu>
cc: www-style@w3.org
Message-ID: <Pine.GSO.4.04.9811192251180.8328-100000@amos.bath.ac.uk>
On Thu, 19 Nov 1998, L. David Baron wrote:
> *Any* adjacent vertical margins in the normal flow are collapsed. 
Hmm. Yes, you're right. Sorry.

So this code snippet:

  <BODY>
   <DIV>
    <UL>
    </UL>
   </DIV>
   <BLOCKQUOTE>
    <OL> 
    </OL>
   </BLOCKQUOTE>
  </BODY>

With this CSS:

  * { padding: 0; border: none; margin: 20px 10px; }
  .BODY { background: #111111; }
  .DIV  { background: #222222; }
  .UL   { background: #333333; }
  .BLOCKQUOTE { background: #444444; }
  .OL   { background: #555555; }

Would make the following containerships:

 BODY
 +-DIV-------------------------+
 | +-UL----------------------+ |
 | |                         | |
 | +-------------------------+ |
 |                             |
 +-----------------------------+
                                
 +-BLOCKQUOTE------------------+
 |                             |
 | +-OL----------------------+ |
 | |                         | |
 | +-------------------------+ |
 +-----------------------------+

And would be rendered like this (where the lines and labels merely
show where the background colours change) because of vertical collapse
of the margins:

 BODY
 +-DIV-------------------------+
 | +-UL----------------------+ |
 | |                         | |
 +-+-------------------------+-+
   BLOCKQUOTE                    <<< *
 +-+-OL----------------------+-+
 | |                         | |
 | +-------------------------+ |
 +-----------------------------+

And you want to know what colour should be used between the OL and
the UL, in the area marked "*"?

Logically, I would say it would be the colour of the BODY: #111111.

-- 
Ian Hickson
Received on Thursday, 19 November 1998 18:09:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:56 GMT