Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML <source> tags


May 05, 2021 HTML Reference Manual


Table of contents


HTML .lt;source> tags

The label can specify one or more media resources for the elements of the .lt;picture>, or the "lt;video"," refer to the following example:

An audio player with two source files. The browser needs to select the source file it supports (or one if it does):

<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support Audio elements.
</audio>

Try it out . . .

Browser support

HTML <source> tags HTML <source> tags HTML <source> tags HTML <source> tags HTML <source> tags

IE 9 Plus, Firefox, Opera, Chrome, and Safari all support the hashtag.

Note: IE 8 or earlier versions of IE browsers do not support the label.


Label definition and instructions for use

The label defines media resources for media elements such as .

The tag allows you to specify that the alternative video/audio file co-browser selects based on its support for media types or codec.


The difference between HTML 4.01 and HTML5

The label is the new label in HTML5.


Property

New : The new property in HTML5.

Attributes value describe
media New media_query Specify the type of media resource for the browser to decide whether to download.
src New URL Specify the URL of the media file.
type New MIME_type Specify the MIME type of media resources.

Global properties

The label supports the global properties of HTML.


The event property

The tag supports the event properties of HTML.


Related articles

HTML DOM Reference Manual: HTML DOM Source Object