HTML <bgsound> tag

Updated: 10/11/2017 by Computer Hope

HTML bgsound tagWhen writing in HTML, the <bgsound> tag is used to embed sound files into a web page. Because the sound file plays automatically when the page loads, and this tag is only supported in Internet Explorer, we recommend using <audio> instead. The following sections contain information about the <bgsound> tag, including an example of its code, as well as related attributes and browser compatibility.

Example code

<bgsound src="../m/example.mp3">

Attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <bgsound> tag, as well as a description of each.

Attribute Description
balance Designates how the audio is split between speakers
loop Designates that the audio file should continuously repeat
src Designates the URL of the audio file
volume Designates the default volume for the audio file

Compatibility

Internet Explorer Firefox Safari Opera Chrome
All versions Not supported Not supported Not supported Not supported

Autoplay, Browser, Compatibility, Loop, Mute, Web page, Web design terms