HTML <img> src Attribute
Example
An image is marked up as follows:
<img src="smiley.gif" alt="Smiley face">
Try it yourself »
Definition and Usage
The required src attribute specifies the URL of the image.
Note: When a web page loads; it is the browser, at that moment, that gets the image from a web server and inserts it into the page. Therefore, make sure that the image actually stay in the same spot in relation to the web page, otherwise your visitors will get a broken link icon. The broken link icon is shown if the browser cannot find the image.
Browser Support
Attribute | |||||
---|---|---|---|---|---|
src | Yes | Yes | Yes | Yes | Yes |
Differences Between HTML 4.01 and HTML5
NONE.
Syntax
<img src="URL">
Attribute Values
Value | Description |
---|---|
URL | The URL of the image. Possible values:
|
HTML <img> tag