Comments

In HTML, comments are used to insert notes or explanations within the code that will not be displayed on the webpage. They are helpful for documenting the code, leaving reminders, or temporarily disabling parts of the code during development.

How to Write Comments in HTML

  • HTML comments start with <!-- and end with -->.
  • Anything between these markers will be treated as a comment and ignored by the browser.
Example
<!-- This is a comment -->
<p>This is a paragraph that will be displayed.</p>
<!-- <p>This paragraph will not be displayed because it is inside a comment.</p> -->

Output

In this example:

  • The first line is a comment and will not be shown on the webpage.
  • The second line is a normal paragraph that will be displayed.
  • The third line contains a paragraph inside a comment, so it will not be displayed.

Whereisstuff is simple learing platform for beginer to advance level to improve there skills in technologies.we will provide all material free of cost.you can write a code in runkit workspace and we provide some extrac features also, you agree to have read and accepted our terms of use, cookie and privacy policy.
© Copyright 2024 www.whereisstuff.com. All rights reserved. Developed by whereisstuff Tech.