HTML Attributes
HTML src attribute
Specifies the resource to load for the given element, such as an image, script or media file. The resource type, loading behavior and security rules depend on the element. Applicable elements include: <audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>, <video>. Check each element’s value rules. Example uses illustrative URLs or local assets; provide the corresponding files or application endpoints when running it.
Formal Syntax & Structure
html syntaxhtml
src="book.jpg"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| src | URL | Specifies the resource to load for the given element, such as an image, script or media file. The resource type, loading behavior and security rules depend on the element. |
Working Example
Example Snippethtml
<img src="book.jpg" alt="Book cover">Browser Compatibility
Minimum supported versions across modern rendering engines
Blink (modern)
Chrome
1
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
1
Yes
WebKit
Safari
1
Yes
Presto / Blink
Opera
≤12.1
Yes
Desktop support for src on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard