HTML source - how to use <source> tag

The HTML <source> tag is used to define multimedia source files for audio and video tags. Alternative audio and video files can be supplied using this tag.

Attributes

The source tag supports the global and event attributes.

src
Defines the URL to the source file for audio and video tags
srcset
>Defines the URL to images to be used in different browsers
media
Defines the media query
sizes
Defines the various sizes for different layouts
type
Defines the mime type of the resource

Examples:

Related HTML tags: