HTML COURSE โข LESSON 11
HTML Comments
HTML comments are notes inside your code. Browsers do not display comments on the web page.
HTML Comment Syntax
HTML Comment
<!-- This is an HTML comment -->
Why Use Comments?
- Explain difficult code.
- Organize large HTML documents.
- Leave notes for yourself or other developers.
- Temporarily hide HTML code.
Comment Example
<!-- Main website heading -->
<h1>Welcome to EDUHUB</h1>
<!-- This paragraph explains the website -->
<p>Learn and improve your knowledge.</p>
Hide HTML Code
You can place HTML code inside a comment to stop the browser from displaying it.
Hidden Code
<!--
<p>This paragraph will not be displayed.</p>
-->
โญ EDUHUB Tip
Comments are useful, but do not place passwords, private information or secret data inside HTML comments.