HTML IMG Tag Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 6 Likes Like Report The HTML <img> tag is used to embed images in a web page. It is an empty or self-closing tag, meaning it doesn’t have a closing tag. It allows to display images from various sources, such as files on a website or URLs from other websites. index.html <html> <head></head> <body style="text-align: center;"> <h3>GeeksforGeeks logo</h3> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png" width="420" height="100" alt="Geeksforgeeks.org"> </body> </html> Syntax<img src="./image.png" alt="image description" width="200" height="100">HTML image Tag AttributesAttributeDescriptionsrcSpecifies the path to the image.altProvides alternate text for the image, useful for informing users about the image and displaying in case of network issues.crossoriginAllows importing images from third-party sites with cross-origin access for use with canvas.height and widthSpecifies the height and width of the image.ismapSpecifies an image as a server-side image map.loadingSpecifies whether a browser should defer loading of images until certain conditions are met or load an image immediately.longdescSpecifies a URL to a detailed description of an image.referrerpolicySpecifies which referrer information to use when fetching an image (e.g., no-referrer, no-referrer-when-downgrade, origin).sizeSpecifies image sizes for different page layouts.srcsetSpecifies a list of image files to use in different situations.usemapSpecifies an image as a client-side image map.Custom styling with image tag index.html <html> <head> <style> img { width: 200px; height: auto; border: 5px solid #4CAF50; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); transition: transform 0.3s ease; } img:hover { transform: scale(1.1); } </style> </head> <body> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png" alt="gfg image"> </body> </html> Now you have clear understanding of HTML <img> so you can implement this knowledge to create some interesting components using CSS and JavaScriptUsing CSSCreate a Responsive CSS Image GalleryBuild a Carousel Using Only CSS AnimationsUsing JavaScriptDevelop a Dynamic Image Gallery Using JSCreate a Custom Image Slider with Navigation Buttons Using JSBuild a Review Carousel with Smooth Transitions Using JSImplement an Autoplay Carousel Using JSDesign a Draggable Card Slider with JS Create Quiz HTML <img> Tag Comment M Mandeep_Sheoran Follow 6 Improve M Mandeep_Sheoran Follow 6 Improve Article Tags : Web Technologies HTML HTML-Tags HTML-Attributes Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like