HTML · Links and media

source

Supplies alternative media for picture, video or audio.

Syntax
<source src="…" type="…">

Example

Try it

Notes

Browsers pick the first source they can play, so list the most efficient format first.

More in this group

a area audio canvas embed figcaption figure iframe

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course