HTML/Elements/bgsound

From W3C Wiki
< HTML‎ | Elements
Revision as of 14:48, 22 July 2011 by Plehegar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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>