HTML

HTML Intro

HTML Intro Quiz

HTML Intro Exercise

HTML Basics

HTML Basic Quiz

HTML Basic Exercise

HTML Advance

HTML Advance Quiz

HTML Advance Exercise

HTML Tags List

HTML Global Attributes

HTML Attributes

FAQs

Image Tag HTML

The img Tag

 

 

The img attribute is used to display images on the webpage. It does not have a closing tag. However, it has an important attribute like src where we can put the image URL.

 

Syntax:-

 

Its syntax is:- < img >

 

Explanation:-

 

Attribute Value Description
alt text Specifies alternate text for image.
crossorigin anonymous
use-credentials
Allow images from third-party sites that allow cross-origin access to be used with canvas.
height pixels Specifies height of an image.
ismap ismap Specifies image as a server-side image map.
loading eager
lazy
Specifies whether browser should load an image immediately or to defer loading of images until some conditions are met.
longdesc URL Specifies URL to a detailed description of image.
referrerpolicy no-referrer
no-referrer-when-downgrade
origin
origin-when-cross-origin
unsafe-url
Specifies which referrer information to use when fetching an image.
sizes sizes Specifies image sizes for different page layouts.
src URL Specifies path to the image.
srcset URL-list Specifies list of image files to use in different situations.
usemap #mapname Specifies image as a client-side image map.
width pixels Specifies width of an image.

Code Explanation

All Tutorials related to HTML Basics

All Sections related to HTML