दोस्तों इस chapter में हम HTML Attributes के बारे में जानेंगे तो चलिए शुरू करते है different elements सामान्य काम करने के अलावा कुछ special प्रकार के काम भी कर सकते हैं। इन special प्रकार के कामों को करने के लिए इन elements के opening tag में कुछ properties को specify किया जाता है। इन properties को हम attributes कहतें हैं।
Attributes के द्वारा Interpreter को additional कमांड्स दी जाती है जो उसे बताती है की किसी element के content को किस प्रकार show करना है।
HTML Attributes के use से आप tags के अंदर के content को अपने अनुसार configure कर सकते हों। इसको हमेशा तत्व के opening tag के अंदर जोड़ा जाता है प्रत्येक attribute में दो part name और value होते है। Name attribute property को परिभाषित करता है। मान संपत्ति को सौंपा जाने वाले value का वर्णन करता है। इसे हमेशा quotation के अंदर जोड़ा जाता है सभी characteristics के name और मान केस संवेदनशील होते हैं।
आइये अब हम HTML Attributes का Syntax देखतें है −
<tagName attrName="value"> Wright Your Some Content Here. </tagName>
आप ऊपर दिए गए syntax में देख सकते है attributes को हमेशा हम starting tag में define करते है और इस को हम name और value के pair में लिखते है।
HTML links को <a> tag के साथ defined किया गया है। link address की href विशेषता को specified करता है।
<!DOCTYPE html> <html> <body> <h2>The Href Attribute</h2> <p>HTML links को a tag के साथ defined किया गया है। link address की href विशेषता को specified करता है</p> <a href="http://htmltpoint.com/">This is a link</a> </body> </html>
HTML links को a tag के साथ defined किया गया है। link address की href विशेषता को specified करता है।
This is a linkHTML images को <img> tag के साथ परिभाषित किया जाता है. Src img tag का attribute है। image का source address set करने के लिए src attribute को use किया जाता है।
<!DOCTYPE html> <html> <body> <h2>The src Attribute</h2> <p>HTML images को img tag के साथ परिभाषित किया जाता है. Src img tag का attribute है। image का source address set करने के लिए src attribute को use किया जाता है।</p> <img src="img/src.jpg" alt="Src" style="width:100%"> </body> </html>
HTML images को img tag के साथ परिभाषित किया जाता है. Src img tag का attribute है। image का source address set करने के लिए src attribute को use किया जाता है।
Html में images के size को set करने के लिए हम size attribute का उपयोग करते है। Size attribute की सहायता से हम images की height और width को set कर सकते हैं।
<!DOCTYPE html> <html> <body> <h2>Size Attributes</h2> <p>Html में images के size को set करने के लिए हम size attribute का उपयोग करते है। Size attribute की सहायता से हम images की height और width को set कर सकते हैं।</p> <img src="img/src.jpg" alt="Src" style="width:100%; height="150"> </body> </html><h3>Result
Html में images के size को set करने के लिए हम size attribute का उपयोग करते है। Size attribute की सहायता से हम images की height और width को set कर सकते हैं।