"."/> ".">
Home > Article > Web Front-end > What is the html tag for adding background music?
##Recommended: "The html tag for adding background music is c13e0c5c6d6db5040172f3e526aa994e. bgsound is used to insert background music, but it is only applicable to IE. It is not applicable to netscape and firefox. Its parameter settings are very few. The syntax is as follows "312386385a542e51bcfa174aec264117".
HTML Video Tutorial"
The html tag for adding background music is c13e0c5c6d6db5040172f3e526aa994e. bgsound is used to insert background music, but it is only applicable to IE and not applicable to netscape and firefox. Its parameter settings are very few. As follows 312386385a542e51bcfa174aec264117src="bjyy.mp3" sets the background music file and path, which can be a relative path or an absolute path. (Playlist files cannot be played) loop=infinite Whether to automatically repeat playback, LOOP=2 means repeating twice, you can use -1 to mean repeating infinitely Use bgsound to set the background music, when Playback will be automatically paused when the window is minimized, and playback will continue when the window is restored. Commonly used methods when setting web page background music include using embed tags and object tagsThe following is a special case where bgsound continues to play when the window is minimized:When bgsound appears When in an iframe page, if the background music in the frame page is loading or playingWhen the iframe is removed, the background music will still continue to play, and it will still play after the window is minimizedStop until the music finishes playing naturally or the window is closed (it will not loop). No matter how the loop attribute of the bgsound tag is set, the music will only play once.
The demo code is as follows:
<iframe id=bgmusic width=30 height=20></iframe> <script language=javascript> function window.onload(){ var bghtml='sound<bgsound src="http://clearsky.gougou.cc/xiaonei/music.asp" loop="-1">'; bgmusic.document.body.innerHTML=bghtml; document.all.bgmusic.removeNode(); } </script>Notes for editingNote: Changing the innerHTML attribute can only be done after the onload event occurs, that is, in the browser After completing the loading of the object.
The above is the detailed content of What is the html tag for adding background music?. For more information, please follow other related articles on the PHP Chinese website!