Use HTML comments wisely

To make your HTML code clearer for you (and for others), you can add comments to your code. These are snippets of code that are ignored by Web browsers, so they’re useful for adding short notes and reminders within the code:


<!-- Navigation area: Highlight a menu item with the "hi" class -->

<div id="nav">
  <ul>
    <li><a href="/">Home</a></li>
    <li class="hi"><a href="/about/">About</a></li>
  </ul>
</div>

Learn how to write and use comments in our HTML Comments tutorial.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *