W3C home > Mailing lists > Public > www-style@w3.org > September 1999

RE: Embedded style and style wrappers (RE: New WD: CSS3 selectors)

From: Jelks Cabaniss <jelks@jelks.nu>
Date: Sun, 26 Sep 1999 22:57:07 -0400
To: "Chris Lilley" <chris@w3.org>
Cc: "Bert Bos" <Bert.Bos@sophia.inria.fr>, <www-style@w3.org>
Message-ID: <NBBBICMNIPCICMKJECCBOEPICOAA.jelks@jelks.nu>
Chris Lilley wrote:

> >         <STYLE ID="x12"><!--
> >                 /* unrendered declarations here */
> >         --></STYLE>
> >
> > it works in *both* IE5 and Gecko: the contents of STYLE are not
> > rendered, but the rest of the document is, according to the
> > embedded style rules.
>
> Instead of that, use a CDATA marked section like this:
>
> <style ID="x12"><![CDATA[
>         /* unrendered declarations here */
>  ]]>
> </style>
>
> Which does the same thing, but is more correct.

Actually, that was the first thing I tried, but IE displays the STYLE contents
(while accurately styling the other stuff), and Gecko displays *everything* as
straight text.

Incidentally, I have also run into difficulties using embedded SCRIPTs in XHTML
with CDATA sections:

	<script type="text/javascript"><![CDATA[
		alert("Hello World");
	// ]]>
	</script>

causes run-time (syntax errors) in IE.

	<script type="text/javascript"><!-- <![CDATA[
		alert("Hello World");
	// ]]> -->
	</script>

seems to work (although my version of Gecko -- through Neoplanet's neat wrapper,
Neozilla -- doesn't seem to want to execute scripts no matter what).

The moral apparently is: avoid embedded *anything*!  :)

/Jelks
Received on Sunday, 26 September 1999 22:58:20 GMT

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