HTML Commenting

HTML comments never display. They are only visible in source code and not visible when viewing a web page in a browser. HTML comments are great for adding notes concerning the code and structure of an HTML page. You can also use HTML comments to ‘disable’ code or sections of your web page.

The following syntax example is a simple HTML comment.

 

In this HTML example, HTML comments show notes about our code for later review or other developers to read.

 

HTML comments can ‘hide’ or ‘disable’ code temporarily while it is in development and then remove the comment tags later to display the HTML in a browser, as shown in the following example.

The above HTML code will not display the second paragraph when viewed in a web browser.