The <source> tag marks multiple media resources for media elements, such as <video> and <audio>.
<source> |
Yes | Yes | Yes | Yes | Yes |
The <source> tag is new in HTML5.
Attribute | Value | Description |
---|---|---|
media | media_query | Set the type of media resource |
src | URL | Set the URL of the media file |
type | media_type | Set the media type of the media resource |
The <source> tag supports the Global Attributes in HTML.
None.
<!DOCTYPE html> <html> <body> <audio controls> <source src="sound.ogg" type="audio/ogg"> <source src="sound.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> </body> </html>