Re: Block Boxes

Frank Boumphrey writes:
 > I'm not sure that I understand this part of the spec too well.
 > 
 > "
 > 8.2.1 Controlling box generation: the 'display' property
 > .....
 > A block-level box acts as a containing block for its descendant boxes, which
 > are either block-level boxes or inline boxes (but not both). Sibling
 > block-level boxes participate in a block formatting context.
 > ......"
 > 
 > The key words I dont undersand are "(but not both)".The literal
 > interpretation of this would appear to make code such as
 > 
 > <DIV>
 >   Div Text
 >   <SPAN>Span Text</SPAN>
 > <DIV>
 > Text in a div in a div
 > </DIV>
 >   More div text
 > </DIV>
 > 
 > Illegal in conforming user-agents.(It works perfectly well in IE4 and Nav)
 > 
 > Was this the intention of the authors of the CSS2 spec?

No, it's not illegal. In fact, this is quite common.

But to describe what happens in this case, we introduced the notion of
"anonymous boxes" (boxes that don't correspond to any named element):
since the outer DIV in your example appears to have both inline and
block-level content, the inline content is considered to be wrapped in
an "anonymous" block-level box.

So now the outer DIV indeed contains only block-level boxes, and the
inner DIV contains only inline boxes.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 93 65 76 92            06902 Sophia Antipolis Cedex, France
  +33 (0)4 92 38 76 92 (<--- after 5 Jan 1998)

Received on Monday, 9 March 1998 13:28:44 UTC