When you are writing HTML, sometimes you want to reduce a reminder, explain a difficult section, or hide some code without removing it. This is where HTML comments come - they are like sticky notes for your code that ignores the browser when showing your webpage.
So, how do you make a comment? This is super easy. Just wrap your text between <!-- and -->. Anything inside those markers is invisible for visitors, but you (or anyone reading your code) are seen.
Here is an example:
The browser leaves the comment and only "Hello, the world!" On screen.
A quick tip: Do not overdo it - many comments can clutter your file. When they help, use them, such as labeled large gathering or marking the change. They did not slow down your site (because browser ignores them), but as soon as you learn, they will make your life easier.
Try to add a comment to your next HTML project - this is a small trick that sounds like a pro -trick!
Sponsored Content
Enhance your HTML skills with our in-depth tutorials and interactive quizzes.
Explore HTML Quiz