Re: Indicating browser support for XHTML1.0

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 UTC