If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
HTML में <img> tag का use web page में image show कराने के लिए किया जाता है। <img> tage का closing tag नहीं होता है।
Example
<img src="image_location">
src attribute के लिए image path देते समय folders का ध्यान रखें अगर वह image किसी folder में है तो folder name के साथ image path दिया जाता है।
For Example :
<img src="folder1/folder2/image">
<img> tag में src सबसे important attribute होता है , इस attribute की value में ही हम उस image का path देते हैं जिसे show करना होता है।
tag में alt attribute का use image name देने के लिए किया जाता है , अगर दिए गए path / location पर image नहीं हुई या किसी दूसरी error की वजह से image show नहीं हुई तो alt attribute में दी गयी value show हो जायगी।
For Example -
<img src="image_tiger" alt="Tiger Image">
Output :
तो कुछ इस तरह से alt attribute work करता है।
<img> में width & height attributes का use image की width , height fix करने के लिए किया जाता है।
For Example -
<img src="/storage/uploads/course/html_1613310520.png" alt="HTML Image" width="150" height="150">
Output :
इन सबके अलावा <img> tag में आप style attribute का भी use कर सकते हैं। हालाँकि आप चाहे तो width , height style attribute में भी define कर सकते हैं।
For Example -
<img src="/storage/uploads/course/html_1613310520.png" alt="HTML Image" style="width:150px;height150px;border:red">
Output :
I Hope अब आपको HTML में <img> tag के बारे में अच्छी तरह से पता चल गया होगा।
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook