Current location - Music Encyclopedia - NetEase Cloud Music - How to use CSS to set background music
How to use CSS to set background music
Classification: Computer/Network >> Programming >> Other programming languages

Problem description:

I link an external style sheet to a web page and use CSS to set the background music. What is the code?

A piece of code in HTML

& ltHEAD & gt

& ltTITLE & gt classic mobile exercise-come on, come on! Hurry up! & lt/TITLE & gt;

& ltlink rel = " style sheet " type = text/CSS href = " BG . CSS " >

& lt/HEAD & gt;

Analysis:

You can use expression combined with JS to control it.

& ltstyle & gt

. Style sound {}

. Style test

{

over:expression((this . ready state = = " plete ")& amp; & amp(this . class name = = " style sound ")| |(

(

myinit=function(oSource)

{

OSource.src= "music address";

}

)、(myinit(this))、(this . class name = " style sound "));

}

& lt/style & gt;

& ltbgSound id = " oSound " class = " style test "/& gt。