src
The address of the embedded file for `<img>`, `<video>`, `<audio>`, `<script>`, `<iframe>`.
Syntax
<img src="/images/photo.jpg" alt="…">Parameters
| Parameter | Type | Description |
|---|---|---|
| src | URL | The file address: an image, video, script or frame. |
Examples
One attribute — different elements:
<img src="/media/photo-200x200.jpg" alt="Coffee beans" width="100">
<audio src="/media/t-rex-roar.mp3" controls></audio>Notes
src embeds a file into the page, while href links to a resource. Paths follow the same rules as in href: / from the site root, no slash from the page's folder. For several versions of an image there is srcset.
See also
Related recipes
In the tutorial
- Images — The img tag, the src and alt attributes, sizes, captions with figure and figcaption, image formats and lazy loading.