HTML5 - Comment




HTML5 Comment

Comment is nothing but it is a statement which is not display on browser window. It is useful to understand the which code is written for what purpose. Comment tags <!-- and --> are use for comment on html5 page.

Syntax

<!--  Html5 comment -->

Example

<!DOCTYPE html>
<html lang="en">
 <body>
<!--  Html page -->
 <p>This is My Html Paragraph<p>
 <p>Html is simple and easy to learn<p>
</body>
</html>

Result

This is My Html Paragraph

Html is Simple and easy to learn

In above example comments are not display on browser

Multiline Comment

Comment may be single line or multiline, syntax for multiline comment is given below.

Syntax

<!--  Html Multi 
Line Comment 
-->

Example

<!DOCTYPE html>
<html lang="en">
 <body>
<!--  
Html page 
Start from here 
-->
 <p>This is My Html Paragraph<p>
 <p>Html is simple and easy to learn<p>
</body>
</html>

Result

This is My Html Paragraph

Html is simple and easy to learn