loader

Loading

CoderrShyam logo

CoderrShyam

HomeAboutContactBlogTutorials
LoginSignup

Getting Started

Quick Start
HTML IntroductionHTML Page StructureHTML TagsHTML ElementsHTML AttributesHTML ID and ClassesHTML Comments

HTML Basic

Head Elements and Media

Advanced Concepts

CoderrShyam logo

CoderrShyam

HomeAboutContactBlogTutorials
LoginSignup
TutorialsHTML TutorialGetting startedHTML Comments

HTML Comments

HTML comments are used to add notes or annotations to an HTML document. They are not displayed on the web page but can be viewed in the source code. Let's take a look at how to add comments in HTML.

Key Points About HTML Comments

  • Comments are ignored by web browsers.
  • They aid in code readability and documentation.
  • HTML comments are denoted by <!-- content -->.
  • The shortcut key for commenting out code is Ctrl + /.
  • HTML supports both single-line and multi-line comments.

Types of Comments in HTML

HTML primarily supports two types of comments:

Single-line Comments

Single-line comments are used to add comments on a single line. They start with <!-- and end with -->. Single-line comments are ideal for short notes or annotations.
Example:

<!-- This is a single-line comment -->

Multi-line Comments

Multi-line comments span across multiple lines, making them ideal for detailed explanations or temporarily disabling blocks of code.
Example:

<!-- 
  This is a multi-line comment.
  It spans multiple lines.
-->

Best Practices for Using Comments

  • Use comments to explain complex code or provide context.
  • Avoid excessive comments that state the obvious.
  • Update comments when modifying code to maintain accuracy.
  • Use comments to disable code temporarily during testing or debugging.

How is this guide?

February 26th, 2026

HTML ID and Classes

HTML offers multiple ways to select and style elements. Two of the most commonly used selectors are IDs and Classes. This blog explores what they are, how to use them, and their differences.

Skeletal Tags

HTML skeletal tags are used to structure the content of a web page. They include the `<html>`, `<head>`, `<title>`, and `<body>` tags. Learn how to use these tags to create a well-structured HTML document.

© 2026CoderrShyamAll Rights Reserved.

On this page

Key Points About HTML Comments
Types of Comments in HTML
Single-line Comments
Multi-line Comments
Best Practices for Using Comments
Follow us on GitHub