The HTML5 source Tag

The <source> tag is applicable for media sources that have to work along with the media elements. For authors who need to put <video> or <audio> elements within the HTML document, the HTML5 <source> tag has to be placed too. By doing this, the alternate audio or video sources that can be used by the web browsers are specified. It has to be noted though that selection may depend on the codec support or media type.

The HTML5 <source> tag is newly introduced in HTML5. This is not used in HTML4.01. The good thing about <source> tag is that even if it is new in HTML5, this is well-accepted in Google Chrome, Safari, Opera, Internet Explorer and Firefox. The HTML5 <source> tag has support for Event Attributes and Global Attributes too.

The attributes for the HTML5 <source> tag are provided below.

Attribute

Value

Description

media (New)

media_query

Determines the type of media that is used as resource

src (New)

URL

Provides information about the URL of the media file

type (New)

MIME_type

This is the indicator of the MIME type for the media resource

 

Featured pages

Overview

Learn about HTML5 architecture, design principles and patterns on HTML5 Overview Tutorial. Become …

Tags

Learn about HTML5 tags and discover a new list of HTML5 tags. Find out about HTML5 tags support by…

Welcome

 Learn HTML5 development techniques, tips and tricks on our website. Find out what is required…

Date Time Picker

HTML5 forms use date and time controls regularly. HTML5 date and time controls are used by booking …