A tag in HTML that is invisible unless viewed through the source code
The HTML comment tag is used to place a comment in the source code. A comment will be unnoticed by the browser. One can use comments to explain the code in the web page which may help the programmer while editing the source code at a later date.
All the manuscript inserted within this tag (<! — … –>) will be ignored by the browser and are unseen for the user. It’s most widespread use is to “conceal” scripts and style codes from older browsers.
It must be noted that, when writing XHTML code the commented scripts and style codes are entirely ignored by the browser.
Any program-specific information can also be added inside the comment tag. In this situation they are not observable for the user, but they are still obtainable to the program. A high-quality practice is to comment the wording inside scripts and style elements to avoid older browsers which do not support scripting or styles from showing it as plain text.
A comment announcement starts with <!, go after by zero or more comments, followed by >. A comment begins and ends with “–” and does not contain any occurrence of “–“.
This means that the following are all legal SGML comments:
It is notable that an empty comment tag, with just “–” characters, should at all times have a multiple of four “-” characters to be legal.
There has been a fable that has bring about over the years that, keywords and keyword phrases listed inside HTML comments tags would improve overall relevancy of the page. This is not true as tested on numerous examinations performed during the years 2002 through 2009.
Comments are classically used by website authors and developers to help one another in providing information significant to blocks of HTML content. They are used in the design practice to illustrate the beginning and end tags for different sections of a document.
These HTML comments should be avoided for stuffing keywords and keyword phrases. As they are considered as HTML markup by user agents. They provide completely no benefit from an SEO/SEM point of view. Actually, the extra code for the HTML comments just adds the overall page weight and may possibly cancel out other page factors.
White space is not permitted between the markup declaration open delimiter (“<!”) and the comment open delimiter (“–“), but is permitted between the comment close delimiter (“–“) and the markup declaration close delimiter (“>”).
A common error is to include a string of hyphens (“—“) within a comment. Authors should avoid putting two or more adjacent hyphens inside comments.
Information that appears between HTML comments tags has no special meaning (e.g., character references are not interpreted as such).