How to Write HTML Comments?

While writing HTML codes, you may want to write HTML comments to easily understand HTML codes. Adding comments in HTML codes for each line clear the purpose of adding that code. This is the best way of coding for developers and programmers.

What are HTML Comments

HTML Comments are the lines visible only in the codes and not in the frontend to the users. Means, there is no effect in the view of your page. These are used to explain the purpose of adding markup codes.

You can find each section of codes easily using the comments in HTML. You can easily analyze the source code in just one view of comments.

How to Write HTML Comments?

To write comments in HTML, you have to add the text inside the starting tag <!-- and the end tag -->. You can add texts as well as the HTML codes inside the comment tags.

This is the single line comment in HTML. However, if you want to add the multiline comments in HTML. You don’t need to use any other tags and can use the same tag as given above.

To add the multiline HTML comments in HTML codes, check the example given below. The below example contains the heading and the paragraphs. You can comment these line of HTML codes using the same starting tag <!-- and end tag -->.

If you want to add as many lines as you want, they all should come under the comment tags given above will consider as the HTML comments. You can add HTML tag inside the HTML comments to make them commented.

You may also like.

Hope, you like this tutorial. If you have any query regarding the HTML comment system. You can comment below to get the solution.



Get FREE Access to Toolkit and Resources that we are using in Tutorialdeep that Every Professional Should Have! in one handy PDF.

Get the PDF

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Download Link Will be Send to Your Email id