Lesson 8: HTML Comments

Adding Developer Comments

HTML comments are notes written directly into the code that are ignored by web browsers and not displayed on the rendered page.

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

Why&How to use :

Comments help document your code structure, explain complex sections, or temporarily disable code during testing and debugging.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Comments</title>
</head>
<body>
<!-- Main content section starts here -->
<h1>Visible Heading</h1>
<!-- <p>This paragraph is commented out and will not display.</p> -->
<p>This paragraph is active and visible.</p>
</body>
</html>