HTML - Image in Hindi




दोस्तों इस chapter में हम HTML Image के बारे में जानेंगे तो चलिए शुरू करते है, Images के उपयोग से एक web page attractive और beautiful बन जाती है, हम किसी भी वेबसाइट में image add करने के लिए <img> tag का उपयोग करते है इसका कोई closing tag नहीं होता है <img> tag को हम body के अंदर डिफाइन करते है और इसके seven attribute होते है

जैसा की आप जानते हो HTML में web page या browser पर image को प्रदर्शित करने के लिए <img> tag का use किया जाता है HTML <img> tag एक खाली tag है जिसमें कई attributes हैं, एक web डेवलपर के रूप में आपको अपने web pages में Images का उपयोग कैसे करते है ठीक से आना चाहिए।

Image Attribute

src, alt, width, height, border, style, id

src attribute − इस attribute अंदर Image का path लिखा जाता है, आपके computer में Image को किस जगह पर रखा गया है उसका पूरा रास्ता आपको scr के अंदर लिखना है होता है।

alt attribute − alt attribute <img> tag का एक बहुत ही important attribute है, और इस attribute की value text के रूप में होती है। इस attribute का उपयोग इसलिए किया जाता है जब कभी आप की image web page पर show नहीं होती है तो उसके स्थान ये text show होता है। दोस्तों इसे आप एक तरह से ये image का alternative भी कह सकते है।

width attribute − इस attribute का उपयोग करके आप अपने image की width को set कर सकते है।

height attribute − इस attribute का उपयोग करके आप अपने image की height को set कर सकते है।

style attribute − इस attribute का उपयोग हम अपने images पर cascading style sheets के rules को apply करने के लिए करते है।

Example

<!DOCTYPE html>
<html>
<body>
<h2>Beautiful nature images</h2>
<img src="img/nature-images.jpg" alt="Nature Images" style="width:100%">
</body>
</html>

Result

Beautiful nature images

Nature Images