Contact Our Development Team
Free Code Tutorials & Open Source Code
HTML Comments
Tutorials > HTML > Comments
HTML Comments
Comments can be useful to explain to someone else (or even to yourself) what a section of your document is designed to do. As HTML is constructed from a set of tags, it quite quickly begins to look very similar when creating complex documents. You can use comments to identify sections of the document which are important. Comments are started with the string <!-- and ended with the string -->. Comments do not show up in the browser when your page is rendered.
<p> <!-- This is a comment, which you can see in the code but not when it is rendered -->
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean in dui odio, eleifend dictum est. Donec felis ante, venenatis eu pellentesque vel, dapibus ac sapien. Proin lorem orci, dapibus et congue ac, venenatis et risus. Vestibulum ligula mauris, tincidunt id rhoncus viverra, mollis vel justo. Proin id tortor enim, ac aliquet nisl. Quisque congue volutpat ullamcorper. Curabitur vel turpis vitae nisi sodales iaculis vitae vel justo. Nulla facilisi. Nam rutrum scelerisque magna, ac eleifend orci consequat non. Vivamus arcu nunc, adipiscing a suscipit vel, faucibus sit amet erat. Praesent vestibulum sollicitudin ullamcorper.
<!-- Here's another comment, in the middle of the paragraph element -->
</p>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean in dui odio, eleifend dictum est. Donec felis ante, venenatis eu pellentesque vel, dapibus ac sapien. Proin lorem orci, dapibus et congue ac, venenatis et risus. Vestibulum ligula mauris, tincidunt id rhoncus viverra, mollis vel justo. Proin id tortor enim, ac aliquet nisl. Quisque congue volutpat ullamcorper. Curabitur vel turpis vitae nisi sodales iaculis vitae vel justo. Nulla facilisi. Nam rutrum scelerisque magna, ac eleifend orci consequat non. Vivamus arcu nunc, adipiscing a suscipit vel, faucibus sit amet erat. Praesent vestibulum sollicitudin ullamcorper.

Page Responses
Currently there have been no responses to this page...
If you have anything to contribute to this tutorial, found a bug, or know a better way of achieving the same goal, please leave your response below.
     
Copyright ©2009, Wired IDS Ltd. | Licensed under Creative Commons Attribution Share-Alike | Load time: 0.3072 seconds