Lesson 6: Comment Tag in HTML

Comment tag is ignored by the browser and it’s invisible to the browser. The purpose of comment tag to facilitate the author for entering the details of tags and document.As you write you web page it is important to add comments that identify who created it,when it was created and,where appropriate,brief explanation of why¬† you have done,what you have done.

Text enclosed in <!–comment–> container will not appear in the browser, but it will appear when you look into the source code.Lets take the example of lesson 5 and modify it by inserting comments.

<H1 align=center>Welcome to sooper tutorials</H1>
<!–Heading 1 center aligned–>
<H2 align=right>Welcome to sooper tutorials</H2>
<!–Heading 2 right aligned–>
<H3>Welcome to sooper tutorials</H3>
<!–Heading 3 left aligned–>
<H4>Welcome to sooper tutorials</H4>
<H5>Welcome to sooper tutorials</H5>
<H6>Welcome to sooper tutorials</H6>

When the document is browsed following output is displayed as shown in the figure below.As discussed comments is not readable by the browser its just for the author information and explanation of HTML document.


After reading this tutorial, you will be able to properly comment you work in HTML document it will allow other to understand your work with ease.

Be Sociable, Share!

Leave a Reply