HTML Comment Tag
The HTML comment is used to ignore a piece of HTML code being rendered in a web browser, simply if you want to hide some HTML content then you can comment on that content, but note that this is not a way to hide something secret because commented HTML content can be seen in source code of a webpage by end-user.
Most commonly, there are two types of comment tags used first one single-line comment <comment> tag and another one multiple-line comment <!-- ..... --> tag to hide code.
<comment> Tag
- <comment> tag is supported by only a few browsers like IE, it is not recommended to use, so try to not use <comment> tag.
- <comment>t tag has both opening and closing tags, see below example.
- <comment><p>This paragraph is commented</p></comment>
<!-- ... --> Tag
This <!-- ... --> is most widely used and supported by web browsers, it is very easy to use, just type all HTML content between <!-- opening and --> closing tags, like the below line.
- <!-- content goges here -->, see below example
- <!-- <p>This paragraph is commented</p> -->