×
   ❮     
HTML CSS MySql Javascript SQL PYTHON JAVA C++ C# BOOTSTRAP REACT XML NODEJS ANGULAR DJango Rust Android VUE
     ❯   

HTML Comment


What is Comment in html?

HTML comments are not displayed in the browser, but they can help document your HTML source code.

Comments allow you to leave notes in your code for yourself or another developer.

HTML Comment syntax:

Syntax

<! -- write your comment here -->
Try it Yourself »

Notice that there is an exclamation point (!) in the start tag, but not in the end tag.


Let's see Example:

Add Comments in HTML Comment

With comments you can place notifications and reminders in your HTML code:

Example

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Comment Example</title>
</head>
<body>
<!-- This is a comment. It won't be displayed in the browser. -->
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text.</p>
<!-- You can add comments anywhere in your HTML code to provide explanations or notes. -->
</body>
</html>
Try it Yourself »

Hey there! Let's go for Learn fasta then! It is more than just coding; it is to have the superpower that can solve any problem. Through simple and easy-to-grasp examples you will sail through the learning process. In addition, it is not just about coding– you will acquire competencies on how to solve complex problems, analyze data, and come up with efficient solutions. Shall we start this wonderful journey together! learnfasta.com terms of use, Copyright 2025 All Rights Reserved.