HTML CSS examples for HTML Tag:source
The <source> element sets multiple alternative media resources for the media elements like <audio> and <video>.
Permitted 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 | New in HTML5 |
<!DOCTYPE html> <html lang="en"> <head> <title>Example of HTML source Tag</title> </head><!--from w w w .ja v a2s .c om--> <body> <video controls="controls"> <source src="your.mp4" type="video/mp4"> <source src="your.ogv" type="video/ogg"> Your browser does not support the HTML5 Video element. </video> </body> </html>
The following table shows the attributes that are specific to the <source> tag.
Attribute | Require | Value | Description |
---|---|---|---|
src | Required | URL | URL of the media file. |
media | Optional | media-query | type of the media resource |
type | Optional | media-type | media type of the media resource. |