०५. HTML attributes in Hindi

HTML and CSS through Hindi, HTML and CSS Lessons
HTML and CSS tutorial for beginners in Hindi

हेलो फ्रेंड्स, KTL's के HTML and CSS tutorial में आपका स्वागत है। आज हम लेसन ५ सीखेंगे।

पिछले लेसन में हम ने header tag के बारे में सीखा।

HTML attributes

आज हम attributes सीखेंगे। हम यह देखेंगे की attributes क्या होते हैं और उनका use कैसे किया जाता है। Attributes elements की ज्यादा information देते हैं। Attribute को attribute नाम और उसकी value होती है। Attributes को opening tag में लिखा जाता है। आज हम कुछ attributes देखेंगे।

१. href attribute:

<a> tag वेब पेज में लिंक बनाने के लिए use करते हैं। लिंक को क्लिक करने पर हम दूसरे वेब पेज में जाते हैं। इस दुसरे वेब पेज का नाम हम "href" attribute में देते हैं।

उदाहरण: <a href=“page-2.html”>Next Page</a>

इस उदाहरण में लिंक को क्लिक करने पर हम "Page-2.html" में जाएंगे। इस लिंक पर टेक्स्ट "Next Page" आएगा। Link tag के बारे में हम "link" के लेसन में सीखेंगे।

२. src attribute:

<image> tag एक पेज में image इन्सर्ट करता है। इस tag के width और height attributes हैं। इसको और एक attribute होता है src।

उदाहरण: <img src=“mango.jpg” style=“width:Xpx; height:Ypx;">

"src" में हम इमेज का नाम देते हैं। Width और height attributes से इमेज का Width और height दे सकते हैं। इमेज के बारे में हम "Image" के लेसन में सीखेंगे।

३. Style attribute:

यह attribute टेक्स्ट के लिए होता है। हम टेक्स्ट का color, font, font size वगैरह "style" attribute में देते हैं।

४. lang attribute:

<html> tag हमें मालूम है। इस tag का attribute होता है language attribute। इस attribute में language का नाम दिया जाता है।

उदाहरण: <html lang="en-US">.

Style attribute

हम style attribute का उदाहरण लेंगे और attribute का उपयोग कैसा करते हैं यह देखेंगे। एक नयी Notepad file ओपन कीजिये और इस में आजका script लिखिए। इस में "Lesson-04" को कॉपी कीजिये।

<h1> tag में लिखिए:


<h1 style="color:blue;">Earth - My planet</h1>


यहाँ पर h1 tag है और style attribute है। यहाँ पर "blue" कलर दिया है। "style" attribute है और "blue" इसकी value है।


Attribute कैसा लिखते हैं ध्यान से देखिये।


<element attribute="attribute value";>


यह syntax याद रखिये।



HTML style attribute in Hindi
आकृति ५-१. HTML style attribute

Source कोड की PDF फाइल देखने के लिए आकृति ५-१. पर क्लिक कीजिये। इसको "Lesson-05" के नाम से save कीजिये और "Lesson-05.html" के नाम से save कीजिये। Windows explorer में जाकर HTML फाइल पर डबल क्लिक कीजिये। आउटपुट देखिये। Heading blue कलर में आया है।


HTML style attribute in Hindi, Heading in blue color
आकृति ५-२. Style attribute - heading in blue color


IMPORTANT POINTS:

१. Attribute एक element के बारे में information देता है।
२. Attribute को opening tag में लिखा जाता है।
३. Attribute की value को double quotes  में लिखा जाता है।

लेसन ४                                   लेसन ६