html tutorial - How to write comments in HTML - html5 - html code - html form



Answer: Use the Syntax "<!-- text -->"

    Comments in HTML are generally used to justify the markup. it help user to select specific section in the document quickly and easily at the time of editing the source code. Comments are not displayed by the browsers. an HTML comment begins with <!--, and ends with -->. See the example below:

    Example

      <!DOCTYPE html>
      <html lang="en">
      <head>
          <meta charset="UTF-8">
          <title>HTML Comment</title>
      </head>
      <body>  
          <!-- This is a single line HTML comment -->
          <!-- This is an example of a
               HTML multi-line comment  -->
          <h1>This is a heading</h1>
          <p>This is a paragraph.</p>
      </body>
      </html>

      Related Searches to How to write comments in HTML