O'Reilly logo

HTML & XHTML: The Definitive Guide, 5th Edition by Chuck Musciano, Bill Kennedy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Background Audio

There is one other form of inline multimedia generally available to web surfers — audio. Most browsers treat audio multimedia as separate documents, downloaded and displayed by special helper applications, applets, or plug-ins. Internet Explorer, on the other hand, contains a built-in sound decoder and supports a special tag (<bgsound>) that lets you integrate with your document an audio file that plays in the background as a soundtrack for your page. [Section 12.1] [Section 12.2]

We applaud the developers of Internet Explorer for providing a mechanism that more cleanly integrates audio into HTML and XHTML documents. The possibilities with audio are very enticing, but at the same time, we caution authors that Internet Explorer’s special tags and attributes for audio don’t work with other browsers, and whether this is the method that the majority of browsers will eventually support is not at all assured.

The <bgsound> Tag

Use the <bgsound> tag to play a soundtrack in the background. This tag is for Internet Explorer documents only. Other browsers ignore the tag. It downloads and plays an audio file when the host document is first downloaded by the user and displayed. The background sound file also will replay whenever the user refreshes the browser display.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required