<bgsound>是 IE 浏览器中设置网页背景音乐的元素。
不要使用它!想要在网页中嵌入音频,应当使用{{HTMLElement("audio")}}.
<bgsound src="sound1.mid"> <bgsound src="sound2.au" loop="infinite">
类似的功能在一些版本的 Netscape 中使用<embed>标签来调用音频播放器。
你可以使用自闭合标签<bgsound />。然后由于它并非标准的一部分,XHTML 会认为它无效。
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatNo}} [1] | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatNo}} [1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
[1] Up to Firefox 22, even if not supporting this element, Gecko was associating it an {{domxref("HTMLSpanElement")}}. This was fixed then and now the associated element is an {{domxref("HTMLUnknownElement")}} as required by the specification.