C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
HTML <source > tagHTML <source> tag is used as a child element to define more than one media resources for <audio>, <video>, and <picture> element. It is used to provide the same media content with different formats such as mp3, mp4, etc. When we embed multiple resources with the same content but different format then the browser may choose the most compatible format and display or play that media file. The <source> tag was introduced in HTML5. Syntax<source src=" " type=" "> Following are some specifications about the HTML <source> tag
Example<!DOCTYPE html> <html> <head> <title>HTML source tag</title> </head> <body> <h2>Example of source tag</h2> <video controls="controls" height="200" width="300"> <source src="flower.webm" type="video/webm" > <source src="flower.mp4" type="video/mp4"> Your browser does not support the HTML5 video element. </video> </body> </html> Output: Attribute:Tag-specific attributes:
Global attribute:The <source> tag supports the Global attributes in HTML. Event attribute:The <source> tag supports the Event attributes in HTML. Supporting Browsers
Next TopicHTML span Tag
|