Course Content
HTML Introduction
0/1
HTML Editors
0/1
HTML Basic Tags
0/1
HTML Elements
0/1
HTML Attributes
0/1
HTML Headings
0/1
HTML Paragraph
0/1
HTML Text Formatting
0/1
HTML Meta Tags
0/1
HTML Quotations
0/1
HTML Comments
0/1
HTML Images
0/1
HTML Background
0/1
HTML Colors
0/1
HTML Lists
0/1
HTML Tables
0/1
HTML Forms
0/1
HTML Spell Check
0/1
HTML Media
0/1
HTML Marquees
0/1
HTML CSS
0/1
HTML Links
0/1
HTML Block & Inline
0/1
HTML Classes
0/1
HTML Id
0/1
HTML I frames
0/1
HTML Java script
0/1
HTML File paths
0/1
HTML Layout
0/1
HTML Responsive
0/1
HTML Computer Code
0/1
HTML Tutorial
About Lesson

 

HTML Comments

HTML comment tag is used to insert comments in the HTML documents.
Comments are a piece of code that is ignored by the browser, but they can help document your HTML source code.

It is a good practice to add comments into your HTML code, especially in long and complex documents, to indicate sections of documents.


Comment Tag

  • You can add one or more comments to your HTML document.
  • Comments are represented by <!–– ––>.
  • It is a good practice of coding to add comments to your HTML source code.
  • Comments help the coder and other people to understand the Source code of the document.
  • The comment tag is useful during the debugging of codes.
  • Browsers automatically ignore comments, but they can help document your HTML source code.

Syntax

<!--This is the syntax of Single-line comment-->

Example :

<!DOCTYPE html>
<html>
  <head>
    <title>HTML comments</title>
  </head>
  <body>
    <!--This is a comment-->
    <p>This is a simple text</p>
  </body>
</html>

Output

<!--This is a comment-->

This is a simple text

Exercise Files
No Attachment Found
No Attachment Found
error: Content is protected !!