<bgsound src="">

Browser
  • IE
  • O
Type

The BGSOUND element is used to adding background sound to a web page.

The sound starts automatically when the page is opened.


<bgsound src="example.wav" loop="3" balance="0" volume="0">

Attribute Value Explanation
src=" " URL the URL of the sound file
loop=" " infinite sets the repeat
infinite : repeats infinitely
number : the number of repeats (the default is 1)
number
balance=" " -10000 - 10000 sets the balance (MSIE only)
a number from -10000 (left) to 10000 (right)
(the default is 0)
volume=" " -10000 - 0 sets the volume (MSIE only)
a number from -10000 (min) to 0 (max)
(the default is 0)

Extension element. (Non standard element)

The data types that can be added :

  • WAVE (.wav)
  • AU (.au)
  • MIDI (.mid)
  • AIFF (.aif)

Example


<bgsound src="example.wav" loop="infinite">

Output
Example pagenew window

The music starts automatically when the page is opened. (Please note the sound volume)

balance : 10000 (right)

<bgsound src="example.wav" loop="infinite" balance="10000">

Output
Example pagenew window

The music starts automatically when the page is opened. (Please note the sound volume)