Summary of comment types in HTML, CSS, and JS

Source: Internet
Author: User

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 */;

    • Comment Location:

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.