HTML Comments

HTML Comment Tag

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

  • You can add notifications and reminders to your HTML code with comments.
  • Comments can be used to hide content.
  • This can help if you want to hide content for a short time.
  • More than one line can also be hidden. Everything between the!— and the –> won\’t show up on the screen.
  • You can hide parts of the HTML code by using comments.
  • Comments are also great for debugging HTML, since you can turn off one line of HTML code at a time to look for mistakes.

You can use the following syntax to add comments to your HTML source:

<!DOCTYPE html>
<html>
<body>

<p>your text here .</p>
<!–
comment html code

<p>Look at this cool image:</p>
<img border=\”0\” src=\”pic_trulli.jpg\” alt=\”Trulli\”>
–>

<p>This is a inline <!–comment–> example.</p>

<!–HTML Comment Tag–>

</body>
</html>

Related Article
Introduction to HTML

HTML Introduction – Learn the Basics of HTML HTML is the starting point of web development. Every website you see Read more

What is HTML

What Is HTML – Complete Beginner Explanation HTML is the foundation of the web. Every website you visit, from simple Read more

HTML Basic Examples

HTML Basic Examples – Learn HTML by Practice The best way to learn HTML is by writing and testing simple Read more

HTML text Editors

HTML Text Editors – Learn How to Write HTML Code To write HTML code, you need a text editor. A Read more

HTML Tags

HTML Tags are the basic units used to create HTML elements.They define how content is displayed in a web browser. Read more

HTML Elements

HTML Elements are the building blocks of every web page.Each element defines a part of the webpage, such as headings, Read more

HTML Attributes

HTML Attributes provide additional information about HTML elements.They help control how elements behave, display, or store extra data. In this Read more

HTML Headings

HTML Headings are used to define titles and subtitles on a web page.They help organize content and improve readability for Read more