HTML Comments


HTML Comments

The HTML comments tag will enable you to insert comments into the HTML portion of your web page that will not be visible within a web browser. They provide a great way to organize your coding for easy editing in the future. They are mainly used for the convenience of the programmer and not a requirement.

Comment tags can also enable you to hide scripts from older web browsers that don’t support them. They will prevent the browser from displaying the script as text.

Comment Tags

Comments are created with the comment tag and are inserted within the HTML portion of a web page.

Although not a requirement, they can be written with an opening comment and a closing comment to specify the beginning and ending of each section.

The great thing about comments is that your visitors won’t see them. However, they will be visible to you the next time you need to edit your HTML. You can simply locate the section you’d liked to edit marked by your comment tags. It makes navigating your HTML much easier — especially if you have a lot of code.

<!–Begin Content Section–>

<p>Web Page Content</p>

<!–End Content Section–>

HTML Comment tags can also enable you to include your most relevant keywords for higher search engine ranking. Although not all search engines will acknowledge them, some will.

<!–Begin Dog Grooming Content–>

<p>Dog grooming Content</p>

<!–End Dog Grooming Content–>

This concludes the HTML comments tutorial. In the next section, we will focus on HTML Image Maps.