← Back to HTML Course | Chapter 1: Introduction & Basics | Lesson 2 of 11

HTML Editors

आपको websites बनाने के लिए महंगे, fancy software की जरूरत नहीं है। आप अपने computer में पहले से installed एक basic text program में HTML लिख सकते हैं। हालांकि, professional code editors एक spell-checker की तरह काम करते हैं, आपकी गलतियों को highlight करते हैं और आपके type खत्म करने से पहले ही tags को autocomplete कर देते हैं। एक code editor को एक smart kitchen counter की तरह सोचें जो आपको जरूरत पड़ते ही tools थमा देता है।

Plain Text बनाम Code Editors

Notepad या TextEdit जैसे सरल tools भी HTML लिख सकते हैं, लेकिन dedicated code editors syntax highlighting, auto-completion, और error detection जैसी सुविधाएं देते हैं। bracket matching और linting जैसे features page reload करने से पहले ही typos पकड़ लेते हैं।

Note: coding को बहुत आसान बनाने के लिए VS Code या Sublime Text जैसा एक लोकप्रिय, मुफ़्त editor download करें।
Warning: code लिखने के लिए Microsoft Word जैसे word processors का उपयोग न करें क्योंकि वे hidden formatting characters inject करते हैं जो HTML को तोड़ देते हैं।

उदाहरण: Plain Text vs. Code Editors

markup
<!DOCTYPE html>
<html>
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Hello world</p>
  </body>
</html>

अपनी HTML Files को Save करना

जब तक आप सही extension के साथ file save नहीं करते, ब्राउज़र आपकी file को webpage के रूप में नहीं पहचानेगा। यह extension कंप्यूटर को बताता है कि file को ब्राउज़र में खोलना है। ज़्यादातर editors डिफ़ॉल्ट रूप से .txt चुनते हैं, इसलिए save करते समय आपको स्पष्ट रूप से .html चुनना होगा।

Note: अपनी मुख्य homepage file का नाम हमेशा index.html रखें।
Warning: सुनिश्चित करें कि आपका editor चुपके से आपके filename के अंत में .txt extension न जोड़ दे।

उदाहरण: Saving Your HTML Files

markup
<!-- Save this file as: index.html -->
<!DOCTYPE html>
<html>
  <body>
    <p>This file must be saved with a .html extension, not .txt</p>
  </body>
</html>

ब्राउज़र में अपनी Files देखना

यह देखने के लिए कि आपका code कैसा दिखता है, आप अपनी saved HTML file को सीधे किसी भी ब्राउज़र में खोल सकते हैं। आप live, real-time preview के लिए code editor extensions भी इस्तेमाल कर सकते हैं। हर save के बाद browser tab को refresh करना beginners के लिए सबसे तेज़ feedback loop है।

Note: अपनी saved HTML file को अपने default web browser में जल्दी launch करने के लिए उस पर double-click करें।
Warning: Local file previews सीधे आपकी hard drive से चलते हैं, जो online host की गई live website से थोड़ा अलग व्यवहार करते हैं।

उदाहरण: Viewing Your Files in a Browser

markup
<!DOCTYPE html>
<html>
  <body>
    <p>Open this file in your browser to see it rendered.</p>
  </body>
</html>

Browser Developer Tools का उपयोग

हर modern ब्राउज़र में built-in developer tools होते हैं, जिन्हें F12 दबाकर या right-click > Inspect करके खोला जाता है, जो आपको किसी page की live HTML structure देखने, छोटे बदलावों को तुरंत test करने, और saved file को edit किए बिना errors देखने देते हैं।

उदाहरण: Using Browser Developer Tools

markup
<!DOCTYPE html>
<html>
  <body>
    <p>Right-click this text and choose "Inspect" to open developer tools.</p>
  </body>
</html>

Code Editor चुनना

VS Code, Sublime Text जैसे लोकप्रिय मुफ़्त code editors, और CodePen या JSFiddle जैसे online editors, सभी syntax highlighting और live preview देते हैं, इसलिए सही चुनाव आमतौर पर इस बात पर निर्भर करता है कि आपको पूरा desktop application चाहिए या zero-install browser tool।

उदाहरण: Choosing a Code Editor

markup
<!--
  Desktop editors: VS Code, Sublime Text
  Online editors: CodePen, JSFiddle
-->
<!DOCTYPE html>
<html>
  <body>
    <p>The same HTML works in any of these editors.</p>
  </body>
</html>
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
🔒

Chapter Quiz — Complete all 11 topics to unlock

0/11 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.