Description

The <source> (short for sourceeter) tag defines sourceeters to be passed to an embedded source at run-time defined by the <source> tag.

Any number of <source> elements may appear inside an element, in any order, but must be placed at the start of the content.

The following table summarizes the usages context and the version history of this tag.

Parent:A media element, like <audio> or <video>
Content:None. It is an empty element.
Start/ End Tag:Start tag: required, End tag: forbidden
Version:HTML 5

Syntax

The basic syntax of the <source> tag is given with:

HTML: <source>; XHTML: <source />

The example below shows the <source> tag in action.

<video controls="controls">
    <source src="shuttle.mp4" type="video/mp4">
    <source src="shuttle.ogv" type="video/ogg">
    Your browser does not support the HTML5 Video element.
</video>    

Note: The <source> element is commonly used to provide the same media resource in multiple formats supported by different browsers.

Tag-Specific Attributes

The following table shows the attributes that are specific to the <source> tag.

Global Attributes

Like all other HTML tags, the <source> tag supports the global attributes in HTML5.

Event Attributes

The <source> tag also supports the event attributes in HTML5.

Browser Compatibility

Element
<source>YesYesYesYesYes