The focus of HTML is to describe the structure. Its feature is to use <and> to define tags, which is very similar to XML. Therefore, HTML annotations use <! -- And --> are also in line with this feature.
CSS is used to define styles and features the use of {And}. From this point of view, it is very similar to C or Js, so it is not surprising to use/* and */As annotations.
You can use // or/* and */annotations in Js.
HTML comment
<! -- Comment content -->
Definition and usage
The comment tag is used to insert comments in the source document. The comment is ignored by the browser. You can use annotations to explain your code. This helps you edit the code later.
You can also store the information customized for the program in the annotation content. In this case, the information is invisible to the user, but available to the program. A good habit is to put comments or style elements into the comment text, so that you can avoid displaying them as plain text in old browsers that do not support scripts or styles.
In addition to the obvious functions in the source document, many web servers also use annotations to implement unique features of the document server software. These servers can scan documents, find specific character sequences from traditional html/XHTML comments, and then take corresponding actions based on the commands embedded in the comments. These actions may be simple including text in other files (such as server-side inclusion, server-inside include), or complex execution of other commands to dynamically generate document content.
CSS comments
/* Comment */
Javascript annotation syntax
// Comment content
/*
Comment content
*/