Latest News
Donation Amounts

Hi 😊

We appreciate you and you help us make a difference. We need your help so that we can provide more services, which means we can provide more low-cost online services to the community. The money also helps our Service work tirelessly, even a penny from your end will mean a lot to us. Because of your donation, we were able to do our best for service. We also appreciate that you are a monthly donor. God Bless You!🙏🙏

Read By Categories

Read By Authors

Recent in Self-Help

3/Self-Help/post-list

Facebook

HTML Comment

HTML Comment

Multiline Comments

Multiline Comments

Multiline Comments

You have seen how to comment a single line in HTML. You can comment multiple lines by the special beginning tag <!–- and ending tag -–> placed before the first line and end of the lastline to be treated as a comment.

Example

<!DOCTYPE html>
<html>
<body>
<!--
This is a multiline comment <br>
and can span through as many as lines you like.
-->
<p>The above content is commented so you cant see it
in output</p>
</body>
</html>

HTML Document Output

The above content is commented so you cant see it in output

Valid vs Invalid Comments

Valid vs Invalid Comments

Valid vs Invalid Comments

Comments do not nest which means a comment cannot be put inside another comment. Second the double-dash sequence "--" may not appear inside a comment except as part of the closing --> tag. You must also make sure that there are no spaces in the start-of comment string.

Example

<!DOCTYPE html>
<html>
<body>
<!--This is valid comment -->
<p>Document content goes here.....<p>
</body>
</html>

HTML Document Output

Document content goes here.....

But, following line is not a valid comment and will be displayed by the browser. This is because there is a space between the left angle bracket and the exclamation mark.

<!DOCTYPE html>
<html>
<body>
< !--This is valid comment -->
<p>Document content goes here.....<p>
</body>
</html>

HTML Document Output

< !-- This is valid comment -->

Document content goes here.....

  • Blogger Comments
  • Facebook Comments

0 Reviews:

Post a Comment

If you have any doubts, Let me know, Please!

Item Reviewed: HTML Comment Rating: 5 Reviewed By: Suriya