HTML files also allow you to add comments to your code.
Comments begin with
<!-- and end with
-->. Any characters in between will be treated as a comment.
Including comments in your code is helpful for many reasons:
- They help you (and others) understand your code if you decide to come back and review it at a much later date.
- They allow you to experiment with new code, without having to delete old code.
<p>The following is a list of my favorite films:</p>
In the example above, the comment is used to denote that the following text makes up a particular section of the page.
In the example above, a valid HTML element (an anchor element) has been "commented out." This practice is useful when you want to experiment with new code without having to delete old code.