HTML files also allow you to add comments to your code.
Comments begin with
<!-- and end with
-->. Any characters in between will be ignored by your browser.
<!-- This is a comment that the browser will not display. -->
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.
<!-- Favorite Films Section --> <p>The following is a list of my favorite films:</p>
In this example, the comment is used to denote that the following text makes up a particular section of the page.
<!-- <p> Test Code </p> -->
In the example above, a valid HTML element (a paragraph element) has been “commented out.” This practice is useful when there is code you want to experiment with, or return to, in the future.
Add a comment to index.html file.