Warning:
This wiki has been archived and is now read-only.

Elements/bgsound

From HTML Wiki
Jump to: navigation, search

<bgsound>

HTML Reference

The <bgsound> element is a non-standard element.

HTML5 classifies it as a non-conforming feature.

Examples

No, really. Don't use it.

Alternative

Use the audio element instead.

<audio autoplay id="bgsound">
 <source src="http://media.w3.org/2010/07/bunny/04-Death_Becomes_Fur.mp4"
         type="audio/mp4">
 <source src="http://media.w3.org/2010/07/bunny/04-Death_Becomes_Fur.oga"
         type="audio/ogg; codecs=vorbis">
 <p>Your user agent does not support the HTML5 Audio element.</p>
</audio>
<button type="button"
        onclick="document.getElementById('bgsound').pause();">
  Stop background sound
</button>

<p>
You'll probably annoy your readers if you use background sounds in documents.
</p>