You are currently viewing Single Line and Multiline Comment in HTML
  • Post category:HTML

Single Line and Multiline Comment in HTML

Single Line Comment HTML

In the article is about we will see about single line comment html. HTML has the same method for both singleline and multiline comments

What are HTML comments?

HTML comments are available from the beginning, we find HTML comments in HTML4, 5, and also the previous version of HTML. The comments are used by designers or developers to explain HTML codes. They are used to add more readability and understandability to the code. One of the most important you need to remember is comments are ignored by the browser, comments are not executed by the browsers. Comments are used to give descriptions of the code.

Syntax of HTML comments

<!--Comment text are here -->
  1. To write a comment, first, we put the less-than (<) symbol then we write the exclamation mark(!) and put (–) double dash, “<!–” that indicates the beginning of the comment tag.
  2. To end a comment tag, first, we write (–) double dash and then put greather-than (<) symbol, so the symbol “–>” indicates the end of the comment tag.

How to use commet in HTML

<title>CSS comments</title>

<!-- The Text is Ignored -->


In the above code, we have a general syntax of HTML.
The body section contains a comment tag with some text inside.
The text doesn’t display in the browser, because the text is inside the comment tag.

Leave a Reply