XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / source

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

source

HTML 5

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

Used with audio and video elements. Authors can use it to provide multiple versions of a media file. When source is used, the attribute src in audio and video elements should not be used. In this case, user agents (browsers) use the first playable file in the list of source elements.

Notes

HTML 5 only.

Start/end tag

This is an empty element. In the XML syntax of HTML 5, it must end with a slash before the closing angle bracket.

Attributes

Global HTML 5 attributes

  • media="all|aural|braille|handheld|print|projection|screen|tty|tv"

    Specifies the media types for which the audio or video file is intended.

  • src="URL"

    Defines the location of the audio or video file.

  • type="MIME-Typ"

    Specifies the media file’s type and can also include the MIME parameter codecs=, which can specify the method used to encode the file.

 

Example

<video>
<source src="media/vacation.ogv" type="video/ogg; codecs='theora, vorbis'">
<source src="media/vacation.mp4" type="video/mp4">
Dieses <code>video</code>-Element wird von Ihrem Browser nicht unterstützt.
</video>

 

> back to the alphabetical list of elements

   

 

 

 

back to top