On 5/27/05, Rick Clark <[EMAIL PROTECTED]> wrote: > <style type="text/css" media="screen"> > /*<![CDATA[*/ > data > /*]]>*/ > </STYLE> > > I thought I was pretty knowledgeable in CSS but have no clue what this is > used for.
In XHTML <script> and <style> blocks containg PCDATA instead of CDATA (IIRC XML DTDs can't specify CDATA). As a result any character with special meaning (such as < or &) would have to be written as < or & since PCDATA is processed for character references. The <![CDATA[ block marks some content as CDATA explicitly. The CSS comments are a hack to deal with the issue that in HTML, <style> blocks ARE CDATA and XHTML served as text/html is supposed to be treated as tag soup HTML and not as XHTML. So you have to comment out the CDATA markers since they aren't allowed in CSS. What makes this even more impressive is that CSS never uses the characters < or & (unless someone slaps them in a comment), so you don't need to mark the block as CDATA in XHTML anyway! I find explicitly CDATA markers nasty at best and much prefer to <link> or <script src="..."></script> my styles and scripts - thus avoiding the whole issue. -- David Dorward <http://dorward.me.uk><http://blog.dorward.me.uk> ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
