Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: not2easy
However, XML compliant browsers (version 6/7 or later) are allowed to silently remove any content within these comments. This might cause unexpected results!
Note that it doesn't matter whether your page follows HTML, XHTML, or XML - the problem is the same. Therefore, do not use comments in your style sheets!
C.4. Embedded Style Sheets and Scripts
Use external style sheets if your style sheet uses < or & or ]]> or --. Use external scripts if your script uses < or & or ]]> or --. Note that XML parsers are permitted to silently remove the contents of comments. Therefore, the historical practice of "hiding" scripts and style sheets within "comments" to make the documents backward compatible is likely to not work as expected in XML-based user agents.
Thus reducing the time my users wait for subsequent pages and (slightly) reducing the load on my server.
`-->` is used with a STYLE element.
`//-->` is the technique in the inside of a SCRIPT element.
Both are frequently used by people in the <style> element. However, both are equally incorrect CSS syntax (which is why they are ignored by browsers).
External CSS is wonderful! I wish more people would listen to your advice :)
You are hiding the <style> tag from some browsers by having it inside a comment.
The correct format is always: <tag><!-- details --></tag>
Any browser that does not uderstand tag, ignore it. It will ignore the comment too. but <!--<tag> details <tag>--> means that all browsers should ignor the whole statement. You are also nesting the < and > symbols which may confuse some browsers, it shouldn't but it might.
1: HTML: <!-- ... -->
2: Style: /* ... */
4: Perl: # ...
It's no wonder it's can become confusing.
There is even no necessity of commenting out, in HTML.
This technique is for the browser which does not understand a STYLE element.
In XML(includes XHTML), the contents of a STYLE element are #PCDATA.
Therefore, `<!-- ... -->` is truly treated as a comment, the contents from `<!--` to `-->` is not parsed.