bgsound

Form

<bgsound>

Attributes

attribute default description
id none specifies the unique ID
class none specifies the style sheet class
src none specifies the URL of the sound file to be played
loop --- specifies the number of times to loop the sound. A value of -1 will cause it to loop indefinitely
balance 0 specifies the balance of the volume between the left and right speakersi-10000 to 10000j
volume --- specifies the volumei-10000 to 0j

Support

Microsoft (MSDN)
[IE3 or later]

Explanation

The bgsound tag specifies a music played in the background. It works only in the Internet Explorer If playing a music in other browsers, you should use the tag like <embed>

Related Tags

embed

Sample Code [Output]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
<bgsound src="hydrancer.mid" balance="0" loop="2">
</head>
<body>
<h1>Sample</h1>
<p>
A music comes only on the IE.
</p>
</body>
</html>