W3C home > Mailing lists > Public > www-html@w3.org > November 2001

Re: Indicating browser support for XHTML1.0

From: Clover Andrew <aclover@1value.com>
Date: Thu, 22 Nov 2001 13:10:11 +0100
Message-ID: <D58B0195B58937489E89124469E57CA249DA3E@EX1.1value.com>
To: <www-html@w3.org>
Christian Wolfgang Hujer <Christian.Hujer@itcqis.com> wrote:

> Short: use <br /> and <hr />, do not use <br></br> or <br/>

Yes, and don't use the <tagname /> shorthand for elements 
which are not defined as empty elements in HTML. <script /> 
is one example likely to go disastrously wrong!

> [CDATA sections] won't work in most browsers. Don't use
> them. For style sheets and scripting still use comments or
> nothing.

Don't use just <!-- ... --> comments, as XML parsers may 
ignore their content, making the script or style not work! 
And if using 'nothing', it's quite tricky to avoid using '<' 
and '&' totally in a script.

If embedding is really required (it's usually best avoided) 
and the document must be compatible with XML, HTML and 
tagsoup parsers, try the Evil Mangled Comments Embedding Hack:

  <script type="text/javascript"><!--//--><![CDATA[//><!-- 
    ...
  //--><!]]></script> 

  <style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    ...
  /*]]>*/--></style> 

sorry about that :-)

-- 
Andrew Clover
Technical Consultant
1VALUE.com AG
Received on Thursday, 22 November 2001 07:09:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:49 GMT