- Introduction
- HTML Document
- Basic Structure
- Comments
- Elements
- Document Structure Elements
- Metadata Elements
- Sections and Layout Elements
- Headings
- Text Content Elements
- Inline Text Semantic Elements
- Media Elements
- Form Elements
- Table Elements
- Interactive Elements
- Scripting / Template Elements
- Edit Elements
- Semantic, Void and Nested Elements
- Block-level and Inline Elements
- Semantic vs. Non-Semantic Elements
- Attributes
- Favicon
- Colors
- File Paths
- URL (Uniform Resource Locator)
- Responsive Web Design
Comments
Learn how to use HTML comments to explain your code without displaying them on the web page.
Loading...
If you want to write your code just to explain it to the user who reads your code, and don't want to render that code on your web page. Then you can use HTML comments.
HTML comments are not displayed in the browser, they are ignored by the browser.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HTML Comments</title>
</head>
<body>
<!-- This is a comment -->
<h1>This is a heading.</h1>
</body>
</html>
You can write the comments between <!-- -->