Comments can make the HTML source codes more readable and easier to maintain.

Any text enclosed in a single tag that begins with <!-- and ends with --> will be ignored by a Web browser. For example, the following statement will be completely ignored by a Web browser.

<!--This is a comment.-->

 

The source codes below demonstrate the use of the comment tag:

<HTML>
<!--This is a comment, which will be ignored by a Web browser.-->
<!--
The comment tag can also be used like this,
so that multiple lines of text can be enclosed in a single comment tag.
-->
<HEAD>
<TITLE>Enter the Page Title Here</TITLE>
</HEAD>
<BODY>
The main contents of the HTML document should be entered here!
</BODY>
</HTML>

Click here to review how the above document appears in a Web browser. Note that the two comment statements are not displayed.

You may select Source from the View menu of your Web browser to review the HTML source code.