HTML Comments are a way to add comments or notes to you HTML webpage (code) that will not be displayed in the web pages content. This functionality is very useful to leaving the comments and notes for yourself and other developers.
HTML comments start with ‘<!--’ and ends with ‘-->’. Anything write between these two symbols will be treated as a comments and ignored by the web browser.
<!-- HTML comments --> <!DOCTYPE html> <html> <head> <title>My Website</title> </head> <body> <h1>Welcome to my website!</h1> <!-- This is a comment --> <p>This is some text on my website.</p> </body> </html>
In this example, the line ‘<-- This is a comment -->’ is a comment and will not be displayed in the web browser.