".">
In HTML5, the source tag is used to provide different types of video or audio files for the browser to select. The syntax is "
The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.
Possible attribute values are as follows:
media media_query specifies the type of media resource for the browser to decide whether to download.
src URL specifies the URL of the media file.
type MIME_type specifies the MIME type of the media resource.
sizes Different page layouts set different image sizes.
srcset URL
The example is as follows:
Audio player with two source files. The browser needs to select the source file it supports (if both are supported, select any one):
Output result:
Recommended tutorial : "html video tutorial"
The above is the detailed content of How to use the source tag of html5. For more information, please follow other related articles on the PHP Chinese website!