W3C home > Mailing lists > Public > www-style@w3.org > December 2006

Re: [CSS21] empty inline elements

From: Bert Bos <bert@w3.org>
Date: Sun, 24 Dec 2006 11:30:50 +0100
Message-ID: <458E56DA.8030709@w3.org>
To: www-style@w3.org

Anne van Kesteren wrote:
> 
> Per section 10.8 of CSS 2.1 
> http://www.w3.org/TR/2006/WD-CSS21-20061106/visudet.html#line-height 
> empty inline elements generate empty inline boxes which will still have 
> margins, etc. We implemented this in Opera, but in doing so it appeared 
> that quite some internal testcases already relied on the "non-standard" 
> behavior so we reverted the fix. We also reverted it because Internet 
> Explorer and Firefox don't seem to implement this per the specification:

Not very strong arguments, are they? :-)

> 
>   http://www.hixie.ch/tests/adhoc/css/box/inline/008.xml
>   http://www.hixie.ch/tests/adhoc/css/box/inline/018.html
>   http://www.hixie.ch/tests/adhoc/css/box/table/empty-cells/006.html
> 
> Perhaps it's better for empty inline elements to not generate empty 
> inline boxes.

Why should there be a difference between empty and non-empty elements? I 
don't see why <span>x</span> should have different height and margins 
then <span></span> (or indeed <span> </span>, even if the space is 
collapsed).

Anyway, you'll need empty elements to generate boxes for cases like these:

     strut {line-height: 2em}
     square {margin-left: 1em}
     another-square {content: "\2003" /* em space */}

     <p>Some text<strut/> more text<square/> and <another-square/>

Netscape's HTML extension <spacer> is also an example.



Bert
-- 
   Bert Bos                                ( W 3 C ) http://www.w3.org/
   http://www.w3.org/people/bos                               W3C/ERCIM
   bert@w3.org                             2004 Rt des Lucioles / BP 93
   +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Sunday, 24 December 2006 10:30:58 GMT

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