HTML <img> srcAttribute
Examples
The image is marked up as follows:
<img src="smiley.gif.html" alt="Smiley face">
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the src attribute.
Definition and Usage
The src attribute of the <img> tag is required. It specifies the URL of the image.
Note:When a web page loads, the browser retrieves the image from a web server and inserts it into the page. Therefore, make sure that the image is in the same location as the associated web page, otherwise visitors may get a broken link icon. If the browser cannot find the image, it will display a broken link icon.
Differences between HTML 4.01 and HTML5
None.
Syntax
<img src="URL.html">
Attribute Values
| Value | Description |
|---|---|
| URL | The URL of the image. Possible values:
|
HTML <img> Tag Other Extensions