HTML source Tag
HTML source Tag
The source tag is used to specify multiple media resources for media elements, such as video, audio, and picture tags. It allows the specific alternatives of video, audio, and picture which the browser may choose from, based on browser support or viewport width.
Attribute Explanation:-
Attribute | Value | Description |
---|---|---|
media | media_query | Accepts any valid media query that would normally be defined in CSS. |
sizes | Specifies image sizes for different page layouts. | |
src | URL | Specifies URL of media file. |
srcset | URL | Specifies URL of image to use in different situations. |
type | MIME-type | Specifies the MIME-type of the resource. |
Syntax:-
Its syntax is:- < source >