HTML Editors and First File
HTML Editors और पहली File
What Do You Need? (spoiler: nothing new)
Method 1: Notepad — first page in 2 minutes
Step 1: Open Notepad (Windows key → type "notepad" → Enter).
Step 2: Type this:
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>I made this page myself.</p>
</body>
</html>
Step 3: File → Save As → filename: index.html → "Save as type": All Files → Save on Desktop.
Step 4: Double-click the file on Desktop — it opens in your browser:
index.html.txt and opens in Notepad, not the browser. Always switch to All Files before saving.Method 2: VS Code — the editor you will actually use
Notepad proves the point; VS Code (free, by Microsoft) is what real developers use. Download from code.visualstudio.com → install with default options.
| Step | Action |
|---|---|
| 1 | File → Open Folder → create/select a folder like my-website |
| 2 | New File icon → name it index.html |
| 3 | Type ! and press Tab → full HTML skeleton appears automatically (Emmet shortcut!) |
| 4 | Write inside <body>, save with Ctrl+S |
VS Code gives you colour-coded tags, auto-closing tags, and error hints — like writing with a teacher looking over your shoulder.
Live Server — see changes instantly
Extensions icon (left bar) → search "Live Server" → Install → then right-click your index.html → "Open with Live Server".
4 beginner mistakes to avoid from day one
- .txt trap: file must END with
.html— check the extension if the page opens in Notepad. - Spaces in filenames: use
about-us.html, neverabout us.html— spaces break links later. - Capital letters: keep filenames lowercase (
index.html, notIndex.HTML) — web servers are case-sensitive, Windows is not, and that mismatch bites at upload time. - Homepage name: the main file is always
index.html— servers open it automatically when someone visits your site.
क्या-क्या चाहिए? (spoiler: कुछ नया नहीं)
तरीका 1: Notepad — 2 minute में पहला page
Step 1: Notepad खोलिए (Windows key → "notepad" लिखिए → Enter).
Step 2: यह type कीजिए:
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>I made this page myself.</p>
</body>
</html>
Step 3: File → Save As → filename: index.html → "Save as type": All Files → Desktop पर Save.
Step 4: Desktop पर file को double-click कीजिए — browser में खुलेगी:
index.html.txt बन जाती है और browser की जगह Notepad में खुलती है. Save से पहले हमेशा All Files चुनिए.तरीका 2: VS Code — जो editor आप असल में use करेंगे
Notepad बात साबित करता है; VS Code (free, Microsoft का) वह है जो असली developers use करते हैं. code.visualstudio.com से download → default options से install.
| Step | Action |
|---|---|
| 1 | File → Open Folder → my-website जैसा folder बनाकर चुनिए |
| 2 | New File icon → नाम दीजिए index.html |
| 3 | ! type करके Tab दबाइए → पूरा HTML skeleton अपने आप आ जाता है (Emmet shortcut!) |
| 4 | <body> के अंदर लिखिए, Ctrl+S से save |
VS Code आपको रंगीन tags, अपने आप बंद होते tags और error hints देता है — जैसे कोई teacher कंधे के पीछे से देखते हुए लिखवा रहा हो.
Live Server — बदलाव तुरंत देखिए
Extensions icon (बाईं पट्टी) → "Live Server" search → Install → फिर अपनी index.html पर right-click → "Open with Live Server".
पहले दिन से बचने वाली 4 गलतियां
- .txt trap: file का अंत
.htmlसे होना ज़रूरी — page Notepad में खुले तो extension check कीजिए. - Filenames में spaces:
about-us.htmlलिखिए, कभीabout us.htmlनहीं — spaces आगे links तोड़ते हैं. - Capital letters: filenames lowercase रखिए (
index.html, न किIndex.HTML) — web servers case-sensitive हैं, Windows नहीं, और यही mismatch upload के समय काटता है. - Homepage का नाम: main file हमेशा
index.html— कोई आपकी site खोले तो server इसे अपने आप दिखाता है.
💻 Live Code Editor
इस पेज का code यहाँ तैयार है — बदलिए और तुरंत नतीजा देखिए. कुछ install किए बिना.console.log देखने के लिए F12 दबाइए.