HTML Comments:-
The HTML comments are not displayed in the browser, but they can help you with document source code.
HTML Comment Tag:-
You can add any comment in your HTML source code that will not be shown in your browser.
Follow the given syntax:
<!-- you can write your comment between this -->
NOTE:- There is an exclamation point (!) that has starting tag, but there is no end tag of this. The browser will not show the executed on-screen that you will write in the comments.
Add Comment:-
With comments, you can place any information or reminder to remind yourself.
<!DOCTYPE html>
<html>
<body>
<!-- you can put any information or reminder that will help you -->
<p> This is a paragraph. </p>
<!-- if you want the text you write will only show you, will not show the other person then you can write text like this that will show only you not in executed screen -->
</body>
</html>
Try this code for a better experience
Hide Content:-
You can use comments to hide your content that will not show the other person.
This can be helpful for you if want to hide content temporarily.
<!DOCTYPE html>
<html>
<body>
<p> This is a paragraph. </p>
<!-- <p> This is another paragraph. </p> -->
<p> The above paragraph will be hidden in the executed screen. </p>
</body>
</html>
Try this code for a better experience
NOTE:- You can hide more than one line even a paragraph or everything between <!-- and --> that will be hidden from the browser. The browser will not show comments that you will write between this <!-- -->.
<!DOCTYPE html>
<html>
<body>
<h1> This is a heading </h1>
<p> This is a paragraph. </p>
<!-- <p> Sami Bhatti <br>
sb ka squad is my youtube channel <br>
I am from Pakistan, from Gujranwala </p> -->
</body>
</html>
Try this code for a better experience
NOTE:- Comments are very useful if you find out any error in your HTML source code you can apply comments on it.
Hide Inline Content:-
Comments can be used to hide any part of the line from the middle of the line.
<!DOCTYPE html>
<html>
<body>
<p> This paragraph is <! --very --> beautiful.</p>
</body>
</html>
Try this code for a better experience
0 Comments