Adding the necessary annotations is a good habit that good programmers must have, which can greatly improve the maintainability and readability of the code. 1. HTML annotations
- <!--the contents of the note--
- Note the place (depending on your personal habits may vary):
After the end of the tag, all this is for the program to be more convenient and clear when nested, such as:
<class= "main"></div> <!-- The contents of the note--
2. CSS Annotations
- /* Contents of comments */
- Location of the note:
Where a module style begins, it shows which module the style is acting on, such as:
/* Header */ { width: 800px; Background-color: #999; } /* Footer */ { width: 800px; Background-color: #EEE; }
3. JavaScript annotations
- Single-line Comment://comment content;
Block-level Comments:/* The contents of the comment */;
Generally add comments to the upper part of a function function, explain function, author, author information, modification time. Such as:
// Output title:document.getElementById ("myH1"). Innerhtml= "Welcome to my homepage";
Summary of comment types in HTML, CSS, and JS