This is an important message requiring you to make a choice if you're based in the EU.

HTML <!-- ... --> tag

The <!-- ... --> tag is used to insert comments in an HTML code. Browsers ignore its content and do not display it. However, the comments are visible to anyone who views the page source code.

The HTML comments are used to indicate sections of a document or insert any notes explaining the code. The comment tag can also be used to exclude temporary code blocks instead of deleting them.

Comments can be used anywhere in the documents except for the <title> tag.


Comments are written between <!-- and --> symbols.


<!DOCTYPE html>
    <title>Example of using the comment tag.</title>
    The content of the page. 
    <!-- This is our comment, that is not displayed on the browser. --> 


The comment tag doesn’t support the Global Attributes.

Browser support

Do you find this helpful?

Related articles