computergeek67
|
Background MusicTime to time if you want to make your website more attractive then you can think about adding some nice background music to it. However please don' forget that html background music needs more bandwidth. The usually used mp3 files are small compared to wav files, but even so much bigger then a normal html page. The W3C not approved | Code: | <body>
<p>HTML background music test</p>
<embed src="bgsound.mp3" autostart="true">
</body> |
This code simply plays the given mp3 file as the page is loaded. However if the file ends the music will stop, so you maybe want to set to play music in a loop. Of course you can do this by the loop parameter and as result your code will look like this:
| Code: | | <embed src="bgsound.mp3" autostart="true" loop="true"> |
You can also controll the size of the browser plugin like this:
| Code: | | <embed src="bgsound.mp3" autostart="true" width="400" height="20"> |
It's nice that with this solution the visitor can control the background music, but it destroys your page design. So you maybe want to hide the control panel of the browser plugin. In case of tag you can also use the hidden parameter as follows:
| Code: | | <embed src="bgsound.mp3" autostart="true" loop="true" hidden="true"> |
At the end once again be careful when to use html background music.
-HTMLF1.com
|