HTML <source>
query_builder | Christopher PisaniThe HTML element <source> is the child element of <audio>. Multiple <source> elements can be added and the first supported format will get in use. If no source is supported, a callback text will be displayed.
Example of element <audio> with multiple audio formats.
<audio controls>
<source src="file1.ogg" type="audio/ogg">
<source src="file2.mp3" type="audio/mpeg">
Files added are not supported by your browser.
</audio>
Available Attributes
Attribute | Values | Functionality |
---|---|---|
src | URL | The location of file |
srcset | URL | The URL of the image to use in multiple situations |
media | media query | Media query that would normally be defined in a CSS |
sizes | value | Image sizes for various display sizes |
type | MIME type | The MIME-type of the resource |