HTML Image
HTML img tag is used to display image on the web page. HTML img tag is an empty tag that contains attributes only, closing tags are not used in HTML image element.
<!DOCTYPE html> <html> <head> <title>Welcome To GFG</title> </head> <body> <h2>GeeksforGeeks</h2> <p>This is the demo of <img /> tag.</p> <img src= "https:interntpoint.com/wp-content/uploads/20210915115837/gfg3-300x300.png" alt="GFG image" /> </body> </html>
Adding images on a webpage:
The <img> tag embeds images in web pages, requiring only attributes without a closing tag. Images enhance design and content quality, linked via the <img> tag to preserve space and optimize webpage performance.
Having an “alt” attribute set for the image is useful for when an image could not load or when you want to add a tooltip description that will be displayed when hovering on top of an image.