Home > Web Front-end > HTML Tutorial > Website background music implementation method_HTML/Xhtml_Web page production

Website background music implementation method_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:38:20
Original
2091 people have browsed it

For individual webmasters, how to make their website unique and full of personality has always been the goal of unremitting efforts. In addition to improving the visual effects and interactive functions of the page as much as possible, if you can hear a beautiful and moving music while opening the web page, I believe this will make your website more colorful.

 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 tag , the other is to add it through the tag.

  (1) Use the tag

Use Dreamweaver to open the page where you need to add background music, click "Code" to open the code editing view, and click on the and select bgsound in the pop-up code prompt box (Figure 1).


Dreamweaver automatically enters the "
 

 Among them, loop="-1" means that the music plays 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 more convenient than Dreamweaver. Just make relevant settings in the "Background" dialog box (Figure 2).


  (2) Use the tag

The method of using the tag to add music is not very common, but its function is very powerful, if combined with some Playback controls can create a Web player.

Its use method is basically the same as the first one, except that in the first step of the code prompt box, do not select gbsound, select embed instead. Then select its attributes and set them accordingly (Figure 3). It can be seen from the figure that embed has many more attributes than gbsound's five attributes. The final code is as follows:
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template