HTML5 source label: media elements define media resources, html5source

Source: Internet
Author: User

HTML5 source label: media elements define media resources, html5source

The HTML5 source tag is a media element (such as <video> and <audio>) to define media resources. <Source> the tag allows you to specify a replaceable video/audio file for the browser to select media type or encoding/decoding support. Here, the host will introduce the application attributes and instances of the source tag.

<Source> tag attributes:

Attribute Value Description
Media Media query Specifies the media resource type.
Src Url Specifies the URL of a media file.
Type Numeric value Specifies the MIME type of a media resource.

<Source> tags support global attributes and event attributes in HTML.

Application instance:

An audio player with two source files. The browser should select the files it supports (if any ):

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

Output:

Differences between HTML 4.01 and HTML 5

<Source> A tag is a new tag in HTML 5.

Summary

The above is the HTML5 source label introduced by the editor: media elements define media resources and hope to help you. If you have any questions, please leave a message for me, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.