Why use comments?
Comments help developers explain sections of code without displaying those explanations on the webpage.
Learn how websites are structured from the ground up using HTML. Build real pages while learning elements, attributes, links, images, forms, tables, semantic HTML and more.
Lesson 16 of 24
8 min learning time
Comments help developers explain sections of code without displaying those explanations on the webpage.
<!-- This is a comment -->
<h1>My Website</h1>
<!--
This section contains
the introduction.
-->
<p>Welcome!</p>
Practical Exercise
Add comments explaining three sections of your HTML document.
Quick Check
Are normal HTML comments displayed on the page?