Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <img> src Attribute

The src attribute on an <img> tag specifies the URL or path of an image file.

The browser uses the URL to locate and load the image file.

Example

#

A src attribute on an <img> element.
The attribute references an image url of a Van Gogh painting.

Van Gogh, Self-portrait
<img src="/img/html/vangogh-lg.jpg"
     alt="Van Gogh, Self-portrait" />

Using src

The src attribute specifies the URL or path of the image to be displayed.

The src URL of the image can be internal (same website) or external (from another website).


Syntax

<img src="URL" />

Values

#

Value Description
URL URL or path of the image file.

Browser support

Here is when src support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <img>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides