ADVERTISEMENT

Html Comment Out Tag? Html Comment Tag

Telegram Group Join Now

ADVERTISEMENT

Html Comment Out Tag? Html Comment Tag

 
 
Html Comment Out Tag? Html Comment Tag
Html Comment Out Tag? Html Comment Tag

 

ADVERTISEMENT

 

What is a Comment Tag in Html?

ADVERTISEMENT

Comments are lines of advice or sentences that explain your code in detail. For example, maybe you have an HTML code that Has like navigation so just write before the nav tag navigation code start from here and do a comment after complete Html navbar structure you add more comments like navbar end here, so there is the best thing that other developers understand where your navbar code and other and how to find as well.

The power of comments is that it doesn’t appear in public but remain in the code only. We will also look through why you should start using comments and why it’s a good practice.

ADVERTISEMENT

How to make Comment in Html

Example-

<!– Navbar code start form here –>

ADVERTISEMENT

In code example

<!-- Navbar code start form here -->
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About us</a></li>
<li><a href="#">Contact us</a></li>
</ul>
</nav>
<!-- Navbar code end here -->

The output on the main page is none. This is because as said earlier, there is no public output of comments. Comments are mainly to help explain your code blocks only.

5+ HTML CSS Projects With Source Code

ADVERTISEMENT

Importance of Comments in Html

Now let’s see why it is so important to add comments in code and why it even exists.

We have heard many people say adding comments makes you a better and good coder. But have you ever wondered why they say so?

ADVERTISEMENT

Let’s see an example use case.

ADVERTISEMENT

Imagine you’re working in a coding company. However, one day you decide to resign and leave your job. What happens is that someone else will take over your previous project. When you add comments, this helps them or junior developers to understand what you have coded and how to complete the project.

 

That is just a real-life scenario. However, honestly, the ultimate reason you should add comments in code is so that you understand your code even better. When you start explaining parts of your code through comments, you will have a clearer understanding of your code.

100+ JavaScript Projects With Source Code ( Beginners to Advanced)

Thus, that is why you should start using comments in your projects.

In this post, we learn What is a Comment in Html and How to make a Comment in Html. If we made a mistake or any confusion, please drop a comment to reply or help you in easy learning.

ADVERTISEMENT

Written by – Code With Random/Anki

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

Telegram Group Join Now

Share on:

Leave a Comment

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT