3 मिनट पढ़ें · मुफ़्त · बिना लॉगिन
हर HTML पेज एक ही बुनियादी बनावट पर चलता है। एक बार इसे सीख लेने के बाद, आप किसी भी वेब पेज का code पढ़कर समझ सकते हैं कि कौन सी चीज़ कहाँ है।
<!DOCTYPE html> — पहली लाइन। यह browser को बताती है: यह एक HTML5 document है। यह कोई tag नहीं है; यह एक declaration है।<html> — root element। पेज की हर चीज़ इसके अंदर होती है।<head> — पेज के बारे में जानकारी: title, character set, CSS के link। Head के अंदर कुछ भी पेज पर दिखता नहीं है।<title> — वह text जो browser tab पर दिखता है। यह head के अंदर होता है।<body> — वह सब कुछ जो visitor सच में देखता है: headings, text, images, links, buttons।ज़्यादातर tags जोड़ों में आते हैं: एक opening tag जैसे <h1> और एक closing tag जैसे </h1>। Content उनके बीच में होता है। कुछ tags, जैसे <br> और <img>, का कोई closing tag नहीं होता — उन्हें empty elements कहा जाता है।
पेज को एक पत्र की तरह समझें। <!DOCTYPE html> लिफाफे पर लगा टिकट है — यह बताता है कि यह किस तरह का document है। <html> खुद लिफाफा है, जिसमें सब कुछ है। <head> लिफाफे पर लिखा पता है — पत्र के बारे में जानकारी, पत्र खुद नहीं। <title> subject line है। और <body> असली पत्र है — वह हिस्सा जिसे लोग पढ़ते हैं।
याद रखने की तरकीब: DOCTYPE = टिकट, html = लिफाफा, head = पता, title = विषय, body = पत्र।
<!DOCTYPE html> <html lang="en"> <head> <title>Page title</title> </head> <body> <h1>Heading</h1> <p>Paragraph.</p> </body> </html>
lang="en" वाला हिस्सा browser को बताता है कि पेज English में है। इससे screen readers शब्दों को सही उच्चारण से पढ़ते हैं, और search engines को पेज समझने में मदद मिलती है।
<head> अदृश्य होता है। उसके अंदर कुछ भी पेज पर नहीं दिखता। शुरुआती लोग अक्सर गलती से दिखने वाला text head में डाल देते हैं — अगर आपका text नहीं दिख रहा है, तो जाँचें कि वह <body> के अंदर है।<body> के अंदर के tags को दो spaces से indent करें। इसमें कुछ खर्च नहीं होता और जब पेज बड़ा होता है तो आपका code पढ़ना बहुत आसान हो जाता है।<!DOCTYPE html> सबसे ऊपर लिखना भूल जाना — तब browser अंदाज़ा लगाता है, और पेज अलग दिख सकता है।<body> के बजाय <head> के अंदर डालना।<h1> headings इस्तेमाल करना — मुख्य heading के लिए सिर्फ एक ही इस्तेमाल करें।lang attribute छोड़ देना — इसे जोड़ने में कुछ सेकंड लगते हैं और यह सबकी मदद करता है।<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
नीचे दिया गया कोड बदलें और चलाएँ दबाएँ — परिणाम तुरंत दिखेगा। कोई फाइल सहेजनी नहीं है, कोई लॉगिन नहीं चाहिए।
इस पाठ के बारे में सबसे ज़्यादा पूछे जाने वाले सवाल — सवाल पढ़ें, फिर खोलकर जवाब देखें।
DOCTYPE html, html रूट एलिमेंट, head, title और body। Title ब्राउज़र टैब पर दिखता है और body में वह सब होता है जो देखने वाला देखता है।
पेज के बारे में जानकारी, जैसे title, कैरेक्टर सेट और CSS के लिंक। Head के अंदर कुछ भी पेज पर दिखाई नहीं देता।
हो सकता है आपने उसे गलती से head में लिख दिया हो। दिखने वाला टेक्स्ट हमेशा body के अंदर होना चाहिए।
Finished the lesson? Test yourself with 5 quick questions — you get the answer instantly, with the reason for each one.
1. What is the root element of every HTML page?
2. What appears on the browser tab?
3. Which of these is NOT a tag but a declaration?
4. Where does the visible content of a page go?
5. What does lang="en" tell the browser?
Read the question first, try to answer it in your own words, then open it to check. These are the questions interviewers actually ask.
<!DOCTYPE html> first, then <html> as the root element, <head> for information about the page (title, character set), and <body> for everything the visitor sees.
<head> holds information about the page — the title, the character set, links to CSS. Nothing inside <head> is shown on the page. <body> holds everything the visitor actually sees.
It tells the browser that this is an HTML5 document. It is a declaration, not a tag, and it must be the very first line. Without it, the browser guesses, and the page may look different.
Reading is not enough — now build it yourself. Write the code in the live editor, run it, check the hint if you get stuck, and open the solution only after you have tried.
Create a page with all five parts: <!DOCTYPE html>, <html>, <head>, <title> and <body>. The title must be "My Daily Routine" and the body must have one <h1> and two <p> elements.
<!DOCTYPE html> <html lang="en"> <head> <title>My Daily Routine</title> </head> <body> <h1>My Daily Routine</h1> <p>I wake up at 6 AM and study HTML for one hour.</p> <p>In the evening I practise what I learned and build a small page.</p> </body> </html>
AI आपके लिए कोड लिख सकता है, लेकिन वह आपके लिए सोच नहीं सकता। जब आप HTML खुद सीखते हैं, तो आपका दिमाग असली कौशल बनाता है: आप समझते हैं कि पेज ऐसा क्यों दिखता है, टूटने पर उसे ठीक कर सकते हैं, और परीक्षा या इंटरव्यू में बिना मदद के जवाब दे सकते हैं। यही कौशल नौकरी दिलाता है — कॉपी किया हुआ जवाब नहीं।
सभी 35 पाठ पूरे करें, टेस्ट पास करें (80%), ₹10 दें और अपना सर्टिफिकेट पाएँ।
टेस्ट देंदेखकर सीखना पसंद है? वीडियो कोर्स में वही विषय एक-एक करके सिखाए जाते हैं।
Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.
Browse all coursesAsk about courses, website & more
Request human callback:
Download karne ke liye login karo. Login ke baad yahi page pe rahoge!
Naya ho? Register karo →