HTML stands for HyperText Markup Language
Part 7: Adding Background Sound
To add sound as background music on your page, use the <embed src> tag.
This tag has a few attributes to it. Let's look at them
1. The Embed tag: We will use our sample.mid from before in the
hyperlink, but this time we will embed it.
<embed src="http://www.porshiana.com/sample.mid">
2. Attributes of the Embed tag: Some of the attributes are as
follows:
- volume="50%"---this adjusts the volume
- hidden="true'---True if you want it play, false to let user play it
- autostart="true"---true to automatically start, false to make the user
click it
- loop="3"---loops the song number of times in brackets, or continuously
if you enter true
- Height can also be used when allowing user control
3. Adding the Sound Code: Let's add this as our background sound,
starting automatically, and give the user the option to stop it
Since the volume is also high, I will adjust it
<embed src="http://www.porshiana.com/sample.mid" volume="30%"
hidden="false" autostart="true height="100" loop="true">
Add this code to your html
Save your HTML and Try out your new sound!
The page is looking good, but our links kind of run together.
When you are done, let's go to lesson 8, where we
will work on lists
|