What is the usage of comment notations in style tag?
For example :
<style type="text/css">
<!--
#map{ width:500px;height:500px;float:left }
-->
</style>
Wha开发者_JAVA技巧t is the usage of <!-- -->
?
It stops Netscape 2 era browsers, which don't recognize the <style>
element, from rendering the content as text (since they start to render the content, but it is a comment, so it isn't rendered).
This is described in the HTML specification.
Entirely worthless today, but people keep adding them without understanding them in a cargo cult mentality.
I only use that type of comment for mock up when I want to remember my reasoning behind a certain structure of elements or have something I want to remember to add later. I never use those comments in production webpages.
精彩评论