HTML tag

HTML tag is used as a child element to define more than one media resources for

It is used to provide the same media content with different formats such as mp3, mp4, etc.

When we embed multiple resources with the same content but different format then the browser may choose the most compatible format and display or play that media file.

The tag was introduced in HTML5.

Syntax

Following are some specifications about the HTML tag

Display Inline
Start tag/End tag Empty tag( Only start tag)
Usage Media resource

Example

Test it Now

Output:

HTML source tag

Attribute:

Tag-specific attributes:

Attribute Value Description
media Media_query It determines that for which media/device the linked source is optimized.
sizes It specifies acceptable image sizes for different page layout.
src It determines the URL of media files.
srcset Specifies the URL of the image for different situations. It is only used when is child of element.
type video/ogg
video/mp4
video/webm
audio/ogg
audio/mpeg
It determines the media type of resource.

Global attribute:

The tag supports the Global attributes in HTML.

Event attribute:

The tag supports the Event attributes in HTML.

Supporting Browsers

Element chrome browser Chrome ie browser IE firefox browser Firefox opera browser Opera safari browser Safari
Yes Yes Yes Yes Yes
Next TopicHTML span Tag




Contact US

Email:[email protected]

HTML source Tag
10/30