HTML source src attribute
Examples
Audio player with two source files. The browser should choose which file (if both the source file browsers support):
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
您的浏览器不支持 audio 元素。
</audio>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
您的浏览器不支持 audio 元素。
</audio>
try it"
Browser Support
Internet Explorer 9 +, Firefox, Opera, Chrome and Safari support the src attribute.
Note: 8 and earlier versions of Internet Explorer do not support the <source> tag.
Definition and Usage
URL The src attribute specifies the media files to be played.
Differences between HTML 4.01 and HTML5
<Source> tag is new in HTML5 tags.
grammar
<source src="URL">
Property Value
值 | 描述 |
---|---|
URL | 规定媒体文件的 URL。 可能的值:
|
HTML <source> tag