Re: style sheets with ancient browsers

Joel N. Weber, II writes:
>On Sun, 12 Jan 1997, Hakon Lie wrote:

>>  > The problem is that primitive browsers (like old versions of Lynx)
>>  > will display the stuff inside <STYLE>.  That seems wrong to me.  If
>>  > the <LINK> and <STYLE> are equal, and I'm authoring a page, I'd use
>>  > <LINK>.
>> The problem experienced with older browsers can be "fixed" with
>> enclosing the style sheet in an HTML comment:
>>   <STYLE><!--
>>     ..
>>   --></STYLE>
>Old versions of Lynx don't correctly parse comments, either.  They treat
>them as unrecognized tags.  So if you embed tags in the comments, lynx
>acts as if the comment ends at the end of the first commented out tag, and
>then you see --> on your screen.
>However, since there are no tags inside <STYLE>, the comment would work.
>Still, it bothers me that the comments are comments in some places and
>have to be ignored in others.  It seems that we're kludging to get
>backwords compatibilty, with the net result that 20 years from now, the
>rules for comments are going to be ridiculously complex.

  Comments are ignored everywhere they are valid.  Since <STYLE>'s content
model is CDATA, you don't look for comments within it.  Yet another reason
you should use a real DTD and SGML parser.

>> But I would agree with you that LINK is preferable.
>Can we find a way to write style information in the tags themselves, so
>that <STYLE>H1 {color: blue}</STYLE> could be written as <SOMETHING
>style="H1 {color: blue}">?  Or is that not worthwhile?  (Actually, you can
>do that in <BODY style="H1 {color: blue}">, but we want to get away from
>putting everything on the <BODY> tag)

  You can put a 'style' attribute on _any_ tag, not just body.  And 'style'
applies to just that tag, so you example above is invalid.  You would have
to write:

<h1 style="color: blue">

-Bill P.