HTML的source标签
HTML Source Tag
HTML source tag (
Syntax
<source src="media_file.mp4" type="video/mp4">
Attributes
src
- Defines the URL of media filetype
- Defines the media type
Usage Example
<video controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
This example shows that if the browser does not support the first media format, it will attempt to play the second format specified.
Compatibility
The
Conclusion
HTML source tag is an essential tool for web developers who want to provide alternative media resources for multimedia content. By using the