W3C home > Mailing lists > Public > www-style@w3.org > January 2003

Block boxes inside inline boxes; Legal or not?

From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Date: Tue, 7 Jan 2003 22:46:23 -0500
Message-Id: <p04330102ba414db0c9ca@[192.168.254.4]>
To: www-style@w3.org

The CSS Level 2 spec is explicit that the following is legal:

<DIV>
   Some text
   <P>More text
</DIV>

In particular, it states that an anonymous block level box is 
generated around "Some text".

How about this?

<SPAN>
   Some text
   <P>More text</P>
   Some more text
</SPAN>

My gut is that this is legal too, but I don't see anything in the 
spec squarely on point here. Furthermore, at least one version of one 
browser has been reported not to handle block boxes inside inline 
boxes for XML documents. Thoughts?

Please note, I'm not asking whether this is valid HTML. My interest 
is more in CSS w.r.t XML. Can a display:block element bet a child of 
a display: inline element? In other words can I do this:

block {display: block}
inline {display: inline}
-------------------

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="Above style sheet"?>
<block>
   <inline>
     <block>some text</block>
   </inline>
</block>
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+
Received on Tuesday, 7 January 2003 22:49:39 GMT

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