1. Learn to add music files
There are generally two ways to add background music to a web page. The first is to add it through the ordinary
(1) Use the
Use Dreamweaver to open the page where you need to add background music, click "Code" to open the code editing view, between
Enter "<" in the pop-up code prompt box and select bgsound.Dreamweaver automatically enters the " Among them, loop="-1" means that the music will play in an infinite loop. If If you want to set the number of plays, just change it to the corresponding number. This method of adding background music is the most basic method and the most commonly used method. The background music format supports most of the current mainstream music formats, such as WAV, MID, MP3, etc. If you want to take into account browsers with low Internet speeds, you can use MID sound effects as background music for web pages. Because MID music files are small, they can be loaded and played quickly when the web page is opened. However, MID also has shortcomings. It can only store the melody of music, but does not have nice harmonies or lyrics. If your Internet speed is fast, or you feel that MID music is a bit monotonous, you can also add MP3 music. Just change happy.mid in the above code to happy.mp3. Tip: Adding background music to FrontPage is relatively more convenient than Dreamweaver. Just make relevant settings in the "Background" dialog box. (2) Use the It is not very common to use the The method of using it is basically the same as the first one, except that in the first step of the code prompt box, do not select gbsound, but select embed instead. Then select its attributes and set them accordingly. It can be seen from the figure that embed has many more attributes than gbsound's five attributes. The final code is as follows: . Autostart is used to set whether the music will automatically play when the page is opened, and hidden sets whether to hide the media player. Because embed is actually similar to a music player on a Web page, if it is not hidden, your system's default media plug-in will be displayed. For these two methods, the author believes that both have their own advantages and disadvantages: the first method plays music when the page is opened. If the page is minimized, the music will automatically pause after playing. If you use This will not happen with the second method. As long as the window is not closed, it will keep playing. So I hope you can choose the method of adding music according to your own situation during use. After you have learned the simple method of adding web music, you should work on the interface and functions. We can use "Web Music Player" to create a stylish music player. 1. Learn to add music files There are generally two ways to add background music to a web page. The first is to add it through the ordinary (1) Use the Use Dreamweaver to open the page where you need to add background music, click "Code" to open the code editing view, between
Dreamweaver automatically enters the " Among them, loop="-1" means that the music will play in an infinite loop. If If you want to set the number of plays, just change it to the corresponding number. This method of adding background music is the most basic method and the most commonly used method. The background music format supports most of the current mainstream music formats, such as WAV, MID, MP3, etc. If you want to take into account browsers with low Internet speeds, you can use MID sound effects as the background music of web pages. Because MID music files are small, they can be loaded and played quickly when the web page is opened. However, MID also has shortcomings. It can only store the melody of music, but does not have nice harmonies or lyrics. If your Internet speed is fast or you feel that MID music is a bit monotonous, you can also add MP3 music. Just change happy.mid in the above code to happy.mp3. Tip: Adding background music to FrontPage is relatively more convenient than Dreamweaver. Just make relevant settings in the "Background" dialog box. (2) Use the It is not very common to use the The method of using it is basically the same as the first one, except that in the first step of the code prompt box, do not select gbsound, but select embed instead. Then select its attributes and set them accordingly. It can be seen from the figure that embed has many more attributes than gbsound's five attributes. The final code is as follows: .