HTML, CSS, and JavaScript annotations

Source: Internet
Author: User
Tags comment tag html comment

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

Related Article

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.