HTML - Attributes in Hindi




दोस्तों इस 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 देखतें है −

Syntax

<tagName attrName="value">
 Wright Your Some Content Here.
</tagName>

आप ऊपर दिए गए syntax में देख सकते है attributes को हमेशा हम starting tag में define करते है और इस को हम name और value के pair में लिखते है।

Type Of HTML Attributes

Href Attribute

HTML links को <a> tag के साथ defined किया गया है। link address की href विशेषता को specified करता है।

Example

<!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>

Result

The Href Attribute

HTML links को a tag के साथ defined किया गया है। link address की href विशेषता को specified करता है।

This is a link

Src Attribute

HTML images को <img> tag के साथ परिभाषित किया जाता है. Src img tag का attribute है। image का source address set करने के लिए src attribute को use किया जाता है।

Example

<!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>

Result

The src Attribute

HTML images को img tag के साथ परिभाषित किया जाता है. Src img tag का attribute है। image का source address set करने के लिए src attribute को use किया जाता है।

Src

Width And Height Attributes

Html में images के size को set करने के लिए हम size attribute का उपयोग करते है। Size attribute की सहायता से हम images की height और width को set कर सकते हैं।

Example

<!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

Size Attributes

Html में images के size को set करने के लिए हम size attribute का उपयोग करते है। Size attribute की सहायता से हम images की height और width को set कर सकते हैं।

Src