Saturday, June 27, 2020

HTML COMMENTS :- Single line and Multiline


HTML COMMENTS

In Html, Comments are the text or sentence that is written in your Html documents.

They are not displayed by the browser. The browser would ignore it.

The comment appears only in your Html documents. They are not rendered or shown by the browser.

Why We Use Html Comments

It is good practice for both programmers and beginners to write comments in his Html documents.
The comment is a type of code that tells the programmer or web developers what this code is going to do or why this code is written.

How to write Html Comment?

An Html comment starts with <!-- and ends with -->. Notice that an exclamation point (!) on the starting tag but not on the ending tag. An exclamation point (!) is placed only on start-tag, not on the end tag.

<!-- Comment goes here -->

Single line comments

Comment which comes only on one line is known as Single line comments. Example of single-line comment is below:-

EXAMPLE:- 

<p> This is Paragraph tag. </p>  <!--  This is a Comment -->

OUTPUT:-


Multiline Comments

We have talked about single line comments so far, but you can also comment through multiple lines. Html also supports multi-line comments. You have just put <!-- on the start tag and --> on the end tag. Let’s see through an example

EXAMPLE:-

<body>
<p> This is Paragraph tag. And this is an example of  multiline comment.  </p> 
<!--  
This is an example of a multiline comment. 
-->
</body>

OUTPUT:-



So that it for today guys. I hope you liked the article as well as Html Series. Thank you for your huge support. If you have any quarries related to this article comment below or DM on my social media.

Have a Good day.

PEOPLE ALSO READ:- HTML TEXT FORMATTING
PEOPLE ALSO READ:- HTML STYLES : FULL EXPLAIN


0 comments:

Post a Comment

Like us on facebook

blogger templatesblogger widgets

Follow on Twitter

Linkedin

Categories

Contact Form

Name

Email *

Message *

Mad About Computer. Powered by Blogger.