SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
HTML
1. HTML क्या है? शुरुआत से सीखें आसान हिंदी में 2. HTML लिखने के लिए सबसे अच्छे मुफ्त एडिटर 3. HTML की बुनियादी बनावट: doctype, head, body 4. HTML एलिमेंट क्या है? Tags और Empty Elements 5. HTML Attributes: href, src, alt, title की पूरी सूची 6. HTML Headings h1 से h6: कौन सी हेडिंग कब लगाएँ 7. HTML Paragraph: p Tag, br और pre का इस्तेमाल 8. HTML Style Attribute: रंग, फ़ॉन्ट साइज़ और अलाइनमेंट 9. HTML Formatting Tags: bold, italic, mark और भी 10. HTML Comments: नोट्स लिखना और कोड छिपाना 11. HTML Colors: नाम, HEX, RGB और HSL कलर कोड 12. HTML में CSS: Inline, Internal और External तरीका 13. HTML Links: a Tag, href, नया टैब और ईमेल लिंक 14. HTML Images: img Tag, src, alt और साइज़ 15. HTML Favicon: ब्राउज़र टैब का आइकन कैसे बनाएँ 16. HTML Title Tag: अच्छा पेज टाइटल कैसे लिखें 17. HTML Tables: टेबल बनाना — table, tr, th, td 18. HTML Lists: ul, ol, dl और Nested Lists 19. HTML Block vs Inline Elements में क्या अंतर है 20. HTML Div Tag: कंटेंट जोड़ना और लेआउट बनाना 21. HTML Class Attribute: कई Elements को एक स्टाइल 22. HTML id Attribute: Unique ID, लिंक, CSS, JavaScript 23. HTML Iframe: YouTube, मैप और पेज अंदर दिखाएँ 24. HTML में JavaScript: script Tag और पहला उदाहरण 25. HTML File Paths: Relative vs Absolute Path हिंदी में 26. HTML Head Element: title, meta, charset हिंदी में 27. HTML Layout: header, nav, main, footer की बनावट 28. HTML Responsive Design: हर स्क्रीन पर सही पेज 29. Semantic HTML Tags: मतलब वाले Tag और SEO 30. HTML Forms: input, label, select हिंदी में सीखें 31. HTML Entities क्या है? & < > © उदाहरण 32. HTML Audio और Video Tags: controls और Source 33. HTML Accessibility: alt Text, Label, ARIA क्या है 34. HTML Meta Tags और SEO की बुनियाद आसान भाषा में 35. HTML Quotations: blockquote, q, cite हिंदी में
अंतिम टेस्ट — सर्टिफिकेट ₹10
इस कोड को लाइव चलाएँ
पाठ 5, कुल 35 में

HTML Attributes: href, src, alt, title की पूरी सूची

4 मिनट पढ़ें · मुफ़्त · बिना लॉगिन

भाषा:

Attributes किसी element के बारे में अतिरिक्त जानकारी देते हैं। वे हमेशा start tag के अंदर, name="value" के रूप में होते हैं। Value आमतौर पर double quotes के अंदर लिखी जाती है।

Diagram — देखें, यह सब कैसे जुड़ता है
Infographic: एक HTML attribute के हिस्से

आम attributes

  • href — वह पता जिस पर link जाता है: <a href="https://kamaldnp.com">Visit us</a>
  • src — वह file जिसे image या script load करता है: <img src="photo.jpg">
  • alt — वह text जो तब दिखता है जब image load नहीं हो पाती, और जिसे screen readers पढ़ते हैं।
  • width और height — pixels में image का आकार।
  • title — एक छोटा tooltip जो तब दिखता है जब mouse element पर रुकता है।
  • style — element पर सीधे लिखा गया CSS।

Quotes मायने रखते हैं

Attribute values को हमेशा quotes में रखें। Double quotes standard हैं। Single quotes भी काम करते हैं, लेकिन उन्हें मिलाना या छोड़ देना bugs पैदा करता है — खासकर जब value में खुद spaces हों। उदाहरण के लिए, बिना quotes के href=https://kamaldnp.com काम कर सकता है, लेकिन बिना quotes के title=My Photo टूट जाता है, क्योंकि browser सिर्फ My को value समझता है।

हर element के attributes होते हैं

लगभग हर HTML element global attributes स्वीकार करता है — id, class, style और title। जब आप CSS से पेजों को style करना शुरू करेंगे तो आप id और class का लगातार इस्तेमाल करेंगे, इसलिए उन्हें अभी से याद रखें।

Tip: Attribute के नाम case-sensitive नहीं होते, लेकिन convention यह है कि उन्हें lowercase में लिखा जाए: href, न कि HREF।

Attribute क्या होता है

Attribute वह अतिरिक्त जानकारी है जो आप किसी tag में जोड़ते हैं। यह हमेशा start tag के अंदर, tag के नाम के बाद होता है, और इसका हमेशा एक नाम और एक value होती है: name="value"। Attributes बदलते हैं कि element कैसे व्यवहार करता है या कैसा दिखता है — link को यह जानने के लिए href चाहिए कि कहाँ जाना है, और image को यह जानने के लिए src चाहिए कि कौन सी तस्वीर दिखानी है।

याद रखने की तरकीब: Attribute = नाम + मान — हमेशा start tag के अंदर, हमेशा quotes में।

आम attributes

AttributeValueविवरण
hrefएक वेब पताLink कहाँ जाता है।
srcएक file pathकौन सी image, video या script load करनी है।
alttextवह text जो तब दिखता है जब image load नहीं हो पाती, और जिसे screen readers पढ़ते हैं।
classएक या ज़्यादा नामElements को समूह में रखता है ताकि CSS उन्हें एक साथ style कर सके।
idएक नामपेज पर एक ही element को एक अनोखा नाम देता है।
styleCSS नियमएक element को सीधे style करता है।
titletextअतिरिक्त जानकारी, hover करने पर छोटे tooltip के रूप में दिखती है।

यहाँ वही link दो तरीकों से लिखा गया है। पहला सही है। दूसरा ज़्यादातर browsers में काम करता है, लेकिन यह बुरी practice है और अगर पते में कभी space आ जाए तो आसानी से टूट जाता है।

<a href="https://kamaldnp.com">Visit KAMALDNP</a>
<a href=https://kamaldnp.com>Visit KAMALDNP</a>
Note: कुछ attributes की कोई value ही नहीं होती। उदाहरण के लिए, <input disabled> का मतलब है कि input बंद है — अकेला शब्द disabled ही पूरा attribute है। इन्हें boolean attributes कहा जाता है।
Tip: Values के आसपास हमेशा double quotes इस्तेमाल करें। Single quotes भी काम करते हैं, लेकिन double quotes standard हैं, और जब value में खुद apostrophe हो, जैसे title="Raj's page", तो वे ही एकमात्र सुरक्षित विकल्प हैं।

आम गलतियाँ

  • Values को बिना quotes के छोड़ना — जैसे ही value में space आता है, यह टूट जाता है।
  • Attribute नामों में capital letters इस्तेमाल करना, जैसे HREF — हमेशा छोटे अक्षर इस्तेमाल करें।
  • Equals sign के पहले या बाद में space डालना, जैसे href = "…" — यह काम करता है, लेकिन कोई इसे इस तरह नहीं लिखता।
  • Images पर alt attribute भूल जाना — यह ज़रूरी है, वैकल्पिक नहीं।

उदाहरण

Example
<!DOCTYPE html>
<html>
<head>
<title>Attributes</title>
</head>
<body>

<a href="https://kamaldnp.com" title="Visit KAMALDNP">KAMALDNP Academy</a>
<p><img src="logo.png" alt="KAMALDNP logo" width="120" height="120"></p>

</body>
</html>

परिणाम

परिणाम — ब्राउज़र में यह कैसा दिखता है
परिणाम: HTML Attributes: href, src, alt, title की पूरी सूची

खुद करके देखें — लाइव एडिटर

नीचे दिया गया कोड बदलें और चलाएँ दबाएँ — परिणाम तुरंत दिखेगा। कोई फाइल सहेजनी नहीं है, कोई लॉगिन नहीं चाहिए।

परिणाम

अक्सर पूछे जाने वाले सवाल

इस पाठ के बारे में सबसे ज़्यादा पूछे जाने वाले सवाल — सवाल पढ़ें, फिर खोलकर जवाब देखें।

1. HTML एट्रिब्यूट क्या होता है?

एट्रिब्यूट एलिमेंट के बारे में अतिरिक्त जानकारी देता है। यह स्टार्ट टैग के अंदर नाम बराबर वैल्यू के रूप में लिखा जाता है, आमतौर पर डबल कोट्स में।

2. href एट्रिब्यूट किस काम आता है?

यह बताता है कि लिंक कहाँ जाएगा। जैसे kamaldnp.com का लिंक href से ही उस पते पर खुलता है।

3. एट्रिब्यूट की वैल्यू कोट्स में क्यों लिखनी चाहिए?

बिना कोट्स के वैल्यू में स्पेस आते ही टूट जाती है। जैसे बिना कोट्स के My Photo में ब्राउज़र सिर्फ़ My को वैल्यू मानेगा।

Check yourself — did you get it?

Finished the lesson? Test yourself with 5 quick questions — you get the answer instantly, with the reason for each one.

1. Where do attributes always sit?

Attributes always sit inside the start tag, in the form name="value".

2. Which attribute tells a link where to go?

href holds the address a link goes to: <a href="https://kamaldnp.com">.

3. Which attribute tells an image which picture to load?

src gives the file an image loads: <img src="photo.jpg">.

4. What should you always put around attribute values?

Double quotes are the standard. Unquoted values break the moment a value contains a space.

5. What is the alt attribute for?

alt is the text shown if an image cannot load, and screen readers read it aloud.

Interview questions — can you answer these?

Read the question first, try to answer it in your own words, then open it to check. These are the questions interviewers actually ask.

1. What is an HTML attribute?

Extra information about an element, written inside the start tag in the form name="value". For example, in <a href="https://kamaldnp.com">, href is the attribute and the web address is its value.

2. What is the difference between href and src?

href is used by links (<a>) to say where the link goes. src is used by images, videos and scripts to say which file to load. A link needs href; an image needs src.

3. Why should attribute values always be in double quotes?

Because an unquoted value breaks the moment it contains a space. For example, title=My Photo without quotes breaks — the browser reads only "My" as the value. Double quotes are the standard and always safe.

Try it yourself — build this

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.

1. Link and image

Create a page with a link to https://kamaldnp.com (the link text must be "Visit KAMALDNP") and an image with src="photo.jpg" and alt="My photo".

Hint: The link needs href; the image needs src and alt. Put every value in double quotes.
Open the live editor
Show solution
<!DOCTYPE html>
<html>
<head>
<title>Links and Images</title>
</head>
<body>
<h1>My Favourite Website</h1>
<p><a href="https://kamaldnp.com">Visit KAMALDNP</a></p>
<img src="photo.jpg" alt="My photo">
</body>
</html>

खुद क्यों सीखें — AI से पूछने के बजाय?

AI आपके लिए कोड लिख सकता है, लेकिन वह आपके लिए सोच नहीं सकता। जब आप HTML खुद सीखते हैं, तो आपका दिमाग असली कौशल बनाता है: आप समझते हैं कि पेज ऐसा क्यों दिखता है, टूटने पर उसे ठीक कर सकते हैं, और परीक्षा या इंटरव्यू में बिना मदद के जवाब दे सकते हैं। यही कौशल नौकरी दिलाता है — कॉपी किया हुआ जवाब नहीं।

सर्टिफिकेट पाएँ — सिर्फ ₹10

सभी 35 पाठ पूरे करें, टेस्ट पास करें (80%), ₹10 दें और अपना सर्टिफिकेट पाएँ।

टेस्ट दें

देखकर सीखना पसंद है? वीडियो कोर्स में वही विषय एक-एक करके सिखाए जाते हैं।

Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

Website Design Using WordPress 3 Days (Basic to Advanced)
₹199
View
Android & iOS App Development using Flutter 2026
₹5,000
View
Full Stack PHP Development Course 2026
₹3,000
View
Browse all courses
HTML — Lessons
1. HTML क्या है? शुरुआत से सीखें आसान हिंदी में 2. HTML लिखने के लिए सबसे अच्छे मुफ्त एडिटर 3. HTML की बुनियादी बनावट: doctype, head, body 4. HTML एलिमेंट क्या है? Tags और Empty Elements 5. HTML Attributes: href, src, alt, title की पूरी सूची 6. HTML Headings h1 से h6: कौन सी हेडिंग कब लगाएँ 7. HTML Paragraph: p Tag, br और pre का इस्तेमाल 8. HTML Style Attribute: रंग, फ़ॉन्ट साइज़ और अलाइनमेंट 9. HTML Formatting Tags: bold, italic, mark और भी 10. HTML Comments: नोट्स लिखना और कोड छिपाना 11. HTML Colors: नाम, HEX, RGB और HSL कलर कोड 12. HTML में CSS: Inline, Internal और External तरीका 13. HTML Links: a Tag, href, नया टैब और ईमेल लिंक 14. HTML Images: img Tag, src, alt और साइज़ 15. HTML Favicon: ब्राउज़र टैब का आइकन कैसे बनाएँ 16. HTML Title Tag: अच्छा पेज टाइटल कैसे लिखें 17. HTML Tables: टेबल बनाना — table, tr, th, td 18. HTML Lists: ul, ol, dl और Nested Lists 19. HTML Block vs Inline Elements में क्या अंतर है 20. HTML Div Tag: कंटेंट जोड़ना और लेआउट बनाना 21. HTML Class Attribute: कई Elements को एक स्टाइल 22. HTML id Attribute: Unique ID, लिंक, CSS, JavaScript 23. HTML Iframe: YouTube, मैप और पेज अंदर दिखाएँ 24. HTML में JavaScript: script Tag और पहला उदाहरण 25. HTML File Paths: Relative vs Absolute Path हिंदी में 26. HTML Head Element: title, meta, charset हिंदी में 27. HTML Layout: header, nav, main, footer की बनावट 28. HTML Responsive Design: हर स्क्रीन पर सही पेज 29. Semantic HTML Tags: मतलब वाले Tag और SEO 30. HTML Forms: input, label, select हिंदी में सीखें 31. HTML Entities क्या है? & < > © उदाहरण 32. HTML Audio और Video Tags: controls और Source 33. HTML Accessibility: alt Text, Label, ARIA क्या है 34. HTML Meta Tags और SEO की बुनियाद आसान भाषा में 35. HTML Quotations: blockquote, q, cite हिंदी में
अंतिम टेस्ट — सर्टिफिकेट ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🛡️ 7-Day Money-Back Guarantee
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Download karne ke liye login karo. Login ke baad yahi page pe rahoge!

Naya ho? Register karo →