Change the CSS style is divided into local and global, the following for you to use JavaScript specific implementation, interested friends can refer to the following
First, there are three ways to change styles locally: Directly change the style, change the className and change the csstext to change the className:document.getElementById (' obj '). Classname= "..." Change cssText:document.getElementById (' obj '). style.csstext= "width:20px; Border:solid 1px #f00; "; Change the direct style: document.getElementById (' obj '). style.backgroundcolor= "#003366 ″ Two, the global change style realizes the real-time switching of the page style by changing the value of the href in the chain style, that is," Change Template Style ". First you need to give the target an ID that needs to be changed, such as the code as follows: <link rel= "stylesheet" type= "Text/css" id= "CSS" href= "Firefox.css"/> The call is simple, such as the following code : <span onclick= "javascript:document.getElementById (' CSS '). href= ' ie.css '" > Dot i change style </span>