HTML and CSS Reference
In-Depth Information
Name
source
Synopsis
<source>
(XHTML:
<source/>
or
<source />
)
Not in HTML 4.01
. Used within
audio
and
video
elements,
source
allows authors to speci-
fy multiple versions of a media file. When
source
is used, the
src
attribute should be omitted
from the
audio
and
video
elements. A user agent will go down the list of
source
elements
until it finds a format it is able to play.
Usage
Categories:
None
Permitted contexts:
As the child of an
audio
or
video
element, before any flow content or
track
elements
Permitted content:
Empty
Start/end tags:
This is an empty (void) element, meaning it has only a start tag and may not have any con-
tents. In HTML, the end tag is forbidden. In XHTML, the element must be closed with a
trailing slash (
<source/>
or
<source />
).
Attributes
HTML5 Global Attributes
media="all|aural|braille|handheld|print|projection|screen|tty|tv"
Specifies the target display media for the audio or video file