In this section, you will see the implementation of <source> tag of HTML5.
In this section, you will see the implementation of <source> tag of HTML5.Here, we will see the implementation and use of <source> tag in HTML5. It is used for embedding media resource in media element. It is not available in HTML 4.01. It is nothing itself. So media tag(audio or video) is important for <source> tag.
1-src
2-type
3-media
Declaration syntax of source tag in HTML5.
<media element> <source src="URL" > <source src="URL"> ................................... </media element> |
<!doctype html > <html > <head> <title>Source Tag </title> </head> <body> <p><b>Example of source tag in HTML5.</b></p> <audio controls="controls" > <source src="a1.mp3"> <source src="a2.mp3"> Browser does not support audio tag. </audio> </body> </html> |
The audio tag is only available in HTML5. It is not available in HTML4.01.