May 03, 2021 HTML5
HTML5 is used to define media resources for media elements. Please 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"> 您的浏览器不支持 audio 元素。
</audio>
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.
Labels define media resources for media elements such as slt;video> and slt;audio>
The tab allows you to specify that two video/audio file co-browsers choose based on its support for media types or codec.
The label is the new label in HTML5.
New: The new property in HTML5.
Property | Value | Describe |
---|---|---|
media New | media_query | Specify the type of media resources for the browser to decide whether to download. |
src New | Url | Specify the URL of the media file. |
type New | MIME_type | Specifies the type of MIME for media resources. |
The label supports the global properties of HTML.
The tag supports the event properties of HTML.