In HTML comments are not displayed in the web browser html comment are hiding web application is running in web browswer, but they can help document your HTML source code.
HTML comment Tag: Main Tips
- The <!-- --> is an HTML comment tag.
- To comment out in HTML, insert information between <!-- and this tag--> tags (Hide this code in browsers).
- Commenting in HTML allows developers to leave notes about their code, its functionality or to indicate necessary changes for the future.
Commenting in HTML
We can add comments to your HTML source by using the following syntax like as give below:
<!-- Write your comments between it-->
<p>This will be shown in the browser.</p>
You can also hide more than one line or multiline comment in html, everything between the <!-- and the --> will be hidden from the display.If you want to comment multiple line you can use the following code (learn how to comment out HTML multi-line comments (or block comments))like as ginve below:
<p>This is a paragraph without comment section.</p>
<p>This is html comment section:</p>
<img border="1" src="example.jpg" alt="example image">
<p>This is a paragraph without comment.</p>
Hide Inline Content
Comments can be used to hide parts in the middle of the HTML code.
<p>This <!-- comment text --> is a paragraph.</p>