🧠 What Are Comments?
Comments in HTML let you leave notes or explanations inside your code — without affecting how the webpage looks. They’re invisible in the browser but super helpful for organizing or understanding your code later.
✔Syntax – How to Write a Comment
<!-- This is a comment -->Everything between <!-- and --> is treated as a comment and won’t be displayed.
📗 Best Practices for Using Comments
Use Comments to Label Sections
<!-- Header Section -->
<header>
<h1>Welcome</h1>
</header>Helps you and others know what part of the page you're working on.
Explain Tricky Code (Only When Needed)
<!-- This div keeps the layout centered -->
<div class="container">
<!-- content -->
</div>Close Tags with Comments (Helpful in long files)
</section> <!-- End of About Us section -->Avoid Over-commenting
<!-- This is a paragraph --> <!-- ❌ Not needed -->
<p>This is a paragraph.</p>Don’t write comments for things that are obvious.
📑Quick Reminders
Comments do not appear on the webpage
They don’t affect your layout or design
Use them to make your code easier to understand