Various HTML <img> Tag Attributes
|
Attribute |
Description |
|
|
|
|
src |
Specifies the path to the image file. |
|
|
|
|
alt |
Provides alternate text for the image, useful for accessibility and when the image cannot be displayed. |
|
|
|
|
crossorigin |
Allows importing images from third-party sites with crossorigin access, typically used with canvas. |
|
|
|
|
height |
Specifies the height of the image. |
|
Attribute |
Description |
|
|
|
|
width |
Specifies the width of the image. |
|
|
|
|
ismap |
Specifies an image as a server-side image map. |
|
|
|
|
loading |
Specifies whether the browser should defer image loading or load it immediately. |
|
|
|
|
longdesc |
Specifies a URL to a detailed description of the image. |
|
|
|
|
referrerpolicy |
Specifies which referrer information to use when fetching the image. |
|
|
|
|
sizes |
Specifies image sizes for different page layouts. |
|
|
|
|
srcset |
Specifies a list of image files to use in different situations, allowing for responsive images. |
|
|
|
|
usemap |
Specifies an image as a client-side image map. |