PDA

View Full Version : change the colour of website...



queerfm
07-06-2006, 07:46 PM
hi i wanted to know is there away with CSS i can do the following

i have 3 different website templates they all look the same just the colours of the text and images are different, can i use CSS to show this these are background images by the way does this work with css so when a person click on red it goes to the ed template or blue template etc.

Thanks

Twey
07-06-2006, 08:18 PM
I think you mean how to switch between stylesheets. It is possible, yes.
function switchStyle(cssFile) {
var ss = null;
for(var i = 0, e = document.getElementsByTagName("head")[0].getElementsByTagName("link"); i < e.length; i++)
if(e[i].rel === "stylesheet")
ss = e[i];
if(ss === null)
document.createElement("style");
ss.rel = "stylesheet";
ss.type = "text/css";
ss.href = cssFile;
}

queerfm
07-07-2006, 03:11 PM
so how do i make it look like MSN sorry if that don't make sence but when you click on an image it changes colours how would i do that.

Twey
07-07-2006, 03:16 PM
As a background image:
<div style="background-image: url(green.png);" onclick="this.style.backgroundImage = this.style.backgroundImage.replace(/green/g, 'blue');">

queerfm
07-07-2006, 05:12 PM
sorry but i don't under stand so this is how i think i will do it, make 4 css page and 4 index pages. that should work right?

Twey
07-07-2006, 05:19 PM
You only need one index page and four CSS files. That's the point of CSS.