The <!-- --> are the tags you use to insert comments in your page coding.
Anything you put between the <!-- and --> tags in the body of your web page will be ignored by the browser.
Using Comment Tags in Your Coding
Comments and Notes
You can use the comment tags to insert comments/notes within the coding of your webpage. These comments can be notes to yourself about what the following section of coding is for E.g.
<!--Start of Navigation Bar -->
Your navigation coding
<!--End of Navigation Bar -->
Hide Code from Old Browsers
Remember this from The HTML Document Structure?
Here the comment tags are used to hide the script coding between the <!-- and --> from older browsers that do not support scripting.
Use Comment Tags to Find Problems
A traditional programmer uses the comment tags to isolate/disable sections of coding when testing and troubleshooting their coding.
You can use this method also. If there is a section of code you think is giving you problems, comment it out then view/refresh the page. If the problem goes away then the problem coding is between the comment tags. If the problem is still there, take the comment tags out and try them somewhere else and see if that section is the problem section of coding.
Notes About Comment Tags
- Do not use comment tags for search engine optimization purposes.
- Once you have finished your page, remove the comment tags you have put in as notes to yourself. This will free up file size for the important stuff, content!
This article is from the HTML 4.01 Basics Simplified ebook.