HTML Comments

Similar to other programming languages HTML also provide feature to add some kind of remarks or comment inside the source of webpage. These comments will not display in web browsers. Comments provide additional information to the designer about HTML elements. It is good practice to add proper comments inside source code. The term proper means these comments will be short but descriptive.

Syntax

To add single line or multi line comments HTML use the same syntax.

<!-- Comment text will be here -->

Example

How to use comments in HTML document

Importance of Comments

There are some basic and important uses of comments in HTML source document.

  • It provide help to designer for understanding webpage elements.
  • We can temporarily hide any element from displaying in browser.
  • It can also partially hide any part of the page content.
Comments
Login to TRACK of Comments.