HTML Comments
HTML comments are used to insert notes or explanations in the source code of a webpage. These comments are not displayed by the browser when the page is rendered, so they are useful for leaving messages to yourself or other developers about the code.
Syntax:
- HTML comments start with
<!--
and end with-->
. - Anything written between these symbols will be treated as a comment.
Example:
html<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<!-- This is an H1 heading -->
<h1>Welcome to My Webpage</h1>
<!-- The following paragraph introduces the site -->
<p>This website is about learning HTML basics.</p>
<!-- TODO: Add more content here -->
</body>
</html>
No comments:
Post a Comment