ADVERTISEMENTS

How to write comments in HTML 5

Comments are basically a simple way to understand code and functionality of that code. In HTML, we can write comments by two ways i.e. Single line & Multiple lines comments which helps us to find particular block and understand it by just reading comment.

These are only for understanding of code to developer. Web browsers don't execute comments. The following example will show you example code snippet of HTML comments.

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Write Comments in HTML 5</title>
</head>
<body>  
    <!-- Single line HTML Comment -->
    <!-- An example of a
         HTML multi-line Comment  -->
    <h1>This is a Title of page</h1>
    <p>This is a description.</p>
</body>
</html>

 

Supported Browsers:
  • Internet Explorer
  • Mozilla Firefox
  • Google Chrome
  • Opera
  • Safari

HTML is base requirement for development of webpages. You can learn HTML from our HTML Tutorials and HTML Examples

ADVERTISEMENTS