Comments

Learn how to use HTML comments to explain your code without displaying them on the web page.

Loading...
Comments

If you want to write your code just to explain it to the user who reads your code, and don't want to render that code on your web page. Then you can use HTML comments.

HTML comments are not displayed in the browser, they are ignored by the browser.

<!DOCTYPE HTML>
<html lang="en">
  <head>
   <meta charset="UTF-8" />
   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title>HTML Comments</title>
  </head>
  <body>
   <!-- This is a comment -->
   <h1>This is a heading.</h1>
  </body>
</html>

You can write the comments between <!-- -->