[vox-tech] dumb html question

Micah Cowan vox-tech@lists.lugod.org
Thu, 13 Dec 2001 12:58:41 -0800


On Thu, Dec 13, 2001 at 12:04:47PM -0800, Peter Jay Salzman wrote:
> weblint complains that <STYLE> is empty:
> 
> 	<STYLE type="text/css">
> 		<!-- H1 {font-size: +33pt} -->
> 	</STYLE>
> 
> weblint complains that "< should be written as &lt;":
> 
> 	<STYLE type="text/css">
> 		<!--
> 		H1 {font-size: +33pt}
> 		-->
> 	</STYLE>
> 
> someone help me out here.  what's the correct form?  both work on netscape
> 4.x and opera.   but i'd like for this to weblint clean if possible.
> 
> pete

I checked it out in the HTML standard.  Apparently, the idiom of
commenting out the body of STYLE so that older browsers won't render
it is *not* part of the standard, but is merely a common browser
extension.  So, conforming browsers are not required to interpret the
commented body, even if they would otherwise interpret the
stylesheet.  However, there's technically nothing wrong with an empty
style body - it's valid HTML.  If I were you, I'd turn that warning
off in weblint (if it supports that) - IMO it's better to have it
commented out so that older browsers don't show it.

Citation:
http://www.w3.org/TR/html4/present/styles.html#hiding

Micah