HTML5 how does the source tag work? HTML5 Source Tag Properties Introduction

Source: Internet
Author: User
HTML5 how does the source tag work? HTML5 source Tag properties are described. Now start to introduce the content of this article, mainly for you to talk about the use of HTML5 source tags and HTML5 cource label three properties specific introduction

HTML5 source Tag definition and usage:

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

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>

<source> Tag Basic properties:

    • Media: The type of the resource for the browser to decide whether to download (value: media_query).

    • src: The URL of the media file (value: URL).

    • Type: The MIME type of the media resource (value: Mime_type).

Note:<source> tag tags support HTML global properties and HTML event properties

HTML5 the format of the source tag:

<source src= "Media Resource Address"/>

Html5<source>media Properties:

Use Media properties:

<source src= "Movie.ogg" type= "Video/ogg" media= "screen and (min-width:320px)" >

Html5<source>media attribute definitions and usage:

The media attribute specifies the type of medium resource (the file is optimized for which media/device).

The browser can use this property to determine whether it can play the file. If you can't play it, you can choose not to download it.

Note: This property can accept multiple values.

Html5<source>media property Syntax:

<source media= "Value" >

Note: Media properties for <source> tags are not supported for any browser. So I don't have to say much.

HTML5<SOURCE>SRC Properties:

The definition and usage of the Html5<source>src property:

The src attribute specifies the URL of the media file to play.

Syntax for the Html5<source>src property:

<source src= "URL" >

Examples of use of the Html5<source>src property:

An audio player with two resource files. The browser should select the file 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>

Property value of the Html5<source>src property:

Html5<source>type Properties:

The definition and usage of the Html5<source>type property:

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

Use of 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:

Differences 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 <source> tags.

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

"Recommended"

What is the role of HTML meta tags? HTML META Tags Common Properties introduction

What is the HTML map tag? HTML map tag structure and how to use the detailed method

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.