Re: Margin-color; text-indent; browser detection without script; attribute selector, ! combinator

-- "L. David Baron" <dbaron@fas.harvard.edu> wrote:
> On Wed, 10 Nov 1999 03:04:14 -0800 (PST),
> =?iso-8859-1?q?Matthew=20Brealey?=
> (thelawnet@yahoo.com) wrote:
> > 
> > --- "Braden N. McDaniel" <braden@endoframe.com>
> wrote:
> > > On Mon, 8 Nov 1999, Matthew Brealey wrote:
> > > > CSS 2 spec (at
> > > > http://www.w3.org/TR/REC-CSS2/colors.html#q2),
> section
> > > > 14.2)
> 
> [4th paragraph of section 14.2 snipped]
> 
> > There are potentially differing interpretations of
> > this pargraph, and as with other areas of the spec
> it
> > is somewhat ambiguous.
> 
> I think it means exactly what it says, and nothing
> more.  Note that
> "use it" means to use it as the background for the
> initial containing
> block, which the previous paragraph says covers the
> entire canvas.
> 
> However, there are a number of other problems with
> this paragraph.  See
> [1] for a description of other problems.
> 
> > I still think that this is saying that HTML and
> BODY
> > are equivalent, and consistent with this view is
> the
> > fact that the HTML element does not take the
> style,
> > class or id attributes. In addition, I see HTML's
> role
> > as nothing more than a holder for the whole
> document
> > rather than an element.
> 
> The CSS2 spec is quite clear that HTML is part of
> the rendering tree.
> As Ian pointed out in [2], section 9.1.2 [3] says
> that:
> 
> #  The root of the document tree generates a box
> that serves as the
> #  initial containing block for subsequent layout.
> 
> > > I have also been unable to find a good answer in
> the
> > > spec about which
> > > margin color "wins" when margins are collapsed;
> but,
> > > as you note, settling
> > > this would require additional verbiage. Simply
> > > giving the option of opaque
> > > margins wouldn't settle the issue.
> > Actually this will never be the case.
> > 
> > Margins only collapse when a margin-bottom and a
> > margin-top are adjacent. The colour of margins is
> that
> > of the parent element.
> > 
> > There is never a situation were adjacent vertical
> > margins do not share a parent.
> 
> No, Braden is right.  Any adjacent vertical margins
> collapse.  This
> means the following four margins (those given in
> style attributes)
> collapse (assuming no borders or padding):
> 
> <body style="background: white;">
>   <div style="background: red; margin-bottom: 1em;">
>     <div style="margin-bottom: 1em;">
>     </div>
>   </div>
> <!-- collapsed margin of 1em is here -->
>   <div style="background: blue; margin-top: 1em;">
>     <div style="margin-top: 1em;">
>     </div>
>   </div>
> </body>
> 
> Braden was asking whether the collapsed margin is
> red, blue, or
> white.  As I said in my previous message [4], it's
> white.
Simply on the basis that they collapse from the bottom
of the tree to the top - the first grandchild DIV
collapses with the first child DIV, creating one child
DIV. The child DIV then collapses with the second
child, which has already collapsed with its
grandchild.

I hadn't actually considered this situation, which is
not the same as the one he gave. 

However, the example that he did give is clearly
described in the spec, since the elements in his
example shared a parent.


=====
----------------------------------------------------------
From Matthew Brealey (http://members.tripod.co.uk/lawnet (for law)or http://members.tripod.co.uk/lawnet/WEBFRAME.HTM (for CSS))
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Received on Wednesday, 10 November 1999 09:44:56 UTC