π Short Intro (Why Iβm Writing This)
Iβm currently learning HTML and decided to learn in public by documenting my journey.
This blog is part of my HTML-101 series, where Iβm learning HTML step by step from scratch.
This series is not written by an expert β itβs a beginner learning out loud, sharing:
- what I understand,
- what confuses me,
- and what I learn along the way.
The goal is to build consistency, clarity, and invite discussion.
π What This Blog Covers
In this post, Iβll cover:
- What are HTML Comments
- Syntax of HTML Comments
- Basic Examples
- Important Rule & Limitation
- HTML Comments vs CSS Comments vs JavaScript Comments
- HTML File Naming Convention
- Standard Homepage Name
- Common File Naming Conventions
π GitHub Repository
All my notes, examples, and practice code live here:
π GitHub Repo:
https://github.com/dmz-v-x/html-101
This repo is updated as I continue learning.
π Learning Notes
1. What are HTML Comments.
First of all what are comments?
Comments are simple text annotations within code that explain the purpose, logic, and history of the code making it easier for developers to understand, maintain, and collaborate on the software.
Comments are visible to developers, ignored during rendering, and do not appear on the webpage. But that doesn't mean commented HTML is not sent to the browser, browser still receives comments, the browser simply ignore them visually. So be mindful of what you add in your comments, never put confidential data in comments.
2. Syntax of HTML Comments
Syntax of HTML Comments:
<!-- This is a comment -->
Everything between <!-- and --> is ignored by the browser.
3. Basic Examples
<!-- Page Header -->
<header>
<h1>My Website</h1>
</header>
<p>Hello World</p>
<!-- This paragraph explains the welcome message -->
4. Important Rule & Limitation
- β We CANNOT nest comments
This is invalid:
<!-- Outer comment
<!-- Inner comment -->
HTML will break.
- β Comments are NOT secure
Comments are visible in: Developer Tools
So never put: Password, API Keys, Confidential Logic inside comments.
<!-- Admin password: 123456 --> β NEVER
- β Do NOT comment out large blocks permanently Use comments for explanation, not disabling features.
5. HTML Comments vs CSS Comments vs JavaScript Comments
| Language | Comment Syntax |
|---|---|
| HTML | <!-- comment --> |
| CSS | /* comment */ |
| JavaScript |
// comment or /* comment */
|
6. HTML File Naming Convention
- Use Lowercase Only
index.html β
HomePage.html β
- No spaces in file names
about-us.html β
my portfolio.html β
- hyphens vs underscore
hyphens - β
(recommended)
underscores _ β οΈ (less preferred)
7. Standard Homepage Name
The standard homepage name of HTML file is: index.html
8. Common File Naming Conventions
| File Type | Example |
|---|---|
| Main page | index.html |
| CSS | style.css, main.css |
| JavaScript | script.js, app.js |
| Images | hero.jpg, logo.png |
β οΈ Challenges / Mistakes I Faced
While learning about comments and naming convention for files in HTML the thing that was new for me is that commented HTML still gets received by the browser and we can read it by inspecting them.
So being mindful about what we comment was the key takeaway for me.
If you faced any issues or have any questions, do let me know in the comments π
π¬ Feedback & Discussion
π‘ Iβd love your feedback!
If you notice:
- something incorrect,
- a better explanation,
- or have suggestions to improve my understanding,
please comment below. Iβm happy to learn and correct mistakes.
β Support the Learning Journey
If you find these notes useful:
β Consider giving the GitHub repo a star β
it really motivates me to keep learning and sharing publicly.
π¦ Stay Updated (Twitter / X)
I share learning updates, notes, and progress regularly.
π Follow me on Twitter/X:
https://x.com/_himanshubhatt1
π Whatβs Next
In the next post, Iβll be covering:
π Headings, Paragraphs & Line Breaks
Iβll also continue updating the GitHub repo as I progress.
π Final Thoughts
Thanks for reading!
If youβre also learning HTML, feel free to:
- follow along,
- share your experience,
- or drop questions in the comments π
π Learning in public
π Repo: https://github.com/dmz-v-x/html-101
π¦ Twitter/X: https://x.com/_himanshubhatt1
π¬ Feedback welcome β please comment if anything feels off
β Star the repo if you find it useful
Top comments (0)