Wednesday, 3 August 2016

Comment in Html page or web pages source code|How to insert comments in html

Comment Tag in Html page or website source code.

Comment tags are  used to insert comments in the HTML.Comments are not displayed on the web pages on the browser.But this can help the developer or programmer when the developer has to modify HTML source code.Comments are also helped while testing HTML page because you can comment out HTML lines of code, one at a time, to search for errors.

You can add Comments in your HTML source code by using the following syntax:

<!-- Write or Insert Your Comment Here -->

We use an exclamation mark in the opening tag but not in the close tag.

Example:

<!-- Paragraph tag start -->
<p>This is Paragraph </p>
<!-- Paragraph tag end Here -->

You can also use comment tag directly into other HTML tags without using additional comment tags.
Example:

<!--p>This is Paragraph </p-->

Html Source code:

<!DOCTYPE html>
<html>
    <head>
          <title>Paragraph Tag </title>
    </head>
<body>
<!-- Heading Start -->
<h1> Heading1</h1>
<!-- heading end -->
<!--h2> Heading2</h2-->
</body>
</html>

Output here:-



















Important Note: The text or things within the Comment tags will not be display on web pages.

Comment Below!

No comments:

Post a Comment

Leave a Reply!