The HTML comment tag is one web design function that often baffles people just learning website design for beginners.
One reason is because the comment tag does not give the actual web page special features or functions.
Instead, it’s a “behind the scenes” tag that tells other designers and sometimes browsers what a certain portion of a web page means.
Web Design Tutorial – HTML Comment Tags Explained
Uses for this HTML Code
The HMTL comments are where programmers and web designers can insert comments and helpful information about the page’s design so other designers can read them later if needed.
Comment tags are frequently used to show where certain blocks of HTML content begin and end, to divide the web page’s HTML into sections that are easy to read and update.
Some web design software programs automatically insert HTML comment tags into a web page to initiate some types of scripting language.
Comment tags are hidden to site visitors and they provide no SEO value whatsoever. They should never be used to stuff keywords or phrases into a page’s HTML code, or to try to add lots of content that’s hidden within the code.
Another interesting fact about comments is they are hidden from a programming aspect. In other words, if you put functional code within the comment tags, it will not add that particular feature to the page.
The code will remain hidden and will not become part of the visible web page. So you can add codes for instruction to other website designers or to use as example without it actually affecting the main web page.
How to Write HTML Comment Tags
The following should be used to insert comment tags:
Beginning (without quotes): “<!–“
Ending tag (without quotes): “–>”
EXAMPLE: <!–This is the HTML comment tag I want to write in my page–>
The comments are inserted between these two tags, so you can write messages to other designers that might be editing the page later on.
HTML Comment Tag – A Useful Web Design Tool for Beginners
If you’re just getting started with designing your own website, HTML comment tags can help you remember where and how you created certain design functions within your pages.
The comments can act as reminders for you later on of how you created a particular web page.
Having comments for difficult functions can save you much time and effort later when you need to update a web page.
Finally – Don’t Overuse HTML Comments
Filed under: Web Design