Home Technique HTML comment

HTML comment



HTML Note

Comment Tag Use to insert a comment in the source document, the comment will not be displayed in the browser.

We often do some html annotations in some code, there are many benefits, such as: It is convenient for other programmers in the project group to know your code, and it can be convenient After you have understood and modifications to your code, you can add your own comment in the HTML document.

. Note Do not appear in the page, which can be used to remind web designers recall the relevant program information. The writing line is written as follows:

Note : Two consecutive characters should be connected after the exclamation point, and there are two consecutive characters before the number. Some browsers will strictly check this.

Basic Law

 

Example 1

 

The same is produced in the client's HTML source code. Data:

HTML comment

 

Example 2

 

displayed in the client's HTML source code as:

 

Description

This annotation and HTML are very like, that is, it can be seen in "View Source Code".

Some differences, You can use the expression in this comment (see 2 shown in Example 2). This expression is unlike, different from the page, you can use a variety of expressions, as long as it is legal. For more information, see expression

// and / * / in HTML is also a commonly used annotation, but can only be used in JS and CSS languages, do not work for HTML language!

Note The effect of

You can see that "" "The content of the comment will not be displayed in the browser. Note Tags are used to insert comments in the source code, and the contents of the comments are not displayed in the browser. Comment on key code helps you understand the source code you wrote at the time.

When writing HTML code, we must often do a note next to some key code, there are a lot of benefits, such as: convenient understanding, easy to find or make other programmers in the project group to know you Code, and you can make you modify your code later.

The annotation of key code is a good habit. The annotation of the code is especially important when developing websites or function modules. Because the code in that time is often a few hundred thousand lines, if you don't comment on the key code, you often feel dizzy, and even don't understand the code you wrote at the time.

Standard Properties

Comment tag does not support any standard properties.

Event Attribute

Comment tag does not support any event properties.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP