Learn
HTML Document Standards
Comments

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:

  1. They help you (and others) understand your code if you decide to come back and review it at a much later date.
  2. 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.

Instructions

1.

Add a comment to index.html file.

Folder Icon

Take this course for free

Already have an account?