What is the use of HTML5 source type? HTML5 details of the source tag

Source: Internet
Author: User
What is the use of HTML5 source type? What are the contents of the HTML5 source tag? This article mainly describes the specific properties and usage of the HTML5 source type, as well as a detailed description of the definition and application of the HTML5 source tag (with an instance).

Html5<source>type Attribute instance:

Use the Type property:

<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>

Syntax for the Html5<source>type property:

<source type= "Mime_type" >

Property value of the Html5<source>type property:

Html5<source>type attribute definitions and usage:

The Type property specifies the MIME type of the media resource.

The difference between HTML 4.01 and HTML 5:

The <source> tag is a new label in HTML 5.

Browser support:

Internet Explorer + +, Firefox, Opera, Chrome, and Safari support the type attribute.

Note: Internet Explorer 8 and earlier versions do not support <source> tags.

Html5<source> Tag Example:

Audio player with two copies of 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>

Definition and usage of html5<source> tags:

<source> tags define media resources for media elements such as <video> and <audio>.

The <source> tag allows you to specify a replaceable video/audio file for the browser to select based on its support for the media type or codec.

The HTML5 source tag is a media element (such as <video> and <audio>) that defines a media resource. The <source> tag allows you to specify a replaceable video/audio file for the browser to select based on its support for the media type or codec. Here's the mainframe. Tell us about the application properties and instances of the source tag.

<source> Tag Properties:

The <source> tag supports global attributes and event properties in HTML.

Application Examples:

Audio player with two copies of 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>

The difference between HTML 4.01 and HTML 5:

The <source> tag is a new label in HTML 5.

Summarize

The above is a small series to introduce the HTML5 source tag: Media element definition Media resources, I hope to help you, if you have any questions please leave me a message

"Recommended"

What does the lang attribute in HTML do? What is the effect of the lang attribute in HTML?

What are the new structural elements of HTML5? HTML5 the use of new structural elements (recommended)

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.