HTML comments

When you create a Web page you might spend ages doing it. After a few hours you probably have a good idea of what is on it and why you did it that way. Will you still remember that in three years?

HTML comments are used for you to put notes to yourself in the Web page. These notes do not show in a browser.

Open any HTML page and try putting some comments in using this structure:

<!-- this is my first HTML comment -->
        

You can put anything inside the comments and it will be ignored by the browser. So comments are also useful for hiding bits of code temporarily (perhaps for troubleshooting). Just put the <!-- before the code and the --> after.

submit to reddit Delicious Tweet