PDA

View Full Version : Choosing between CSS stylesheets



wintertide
21-12-2004, 07:41 PM
Hi all,

I'm currently making a small website and I'm messing round with using multiple CSS stylesheets so that visitors can choose between the different styles that I make available. Only problem is, I can't find a way to set these up. I don't want to use Perl or PHP if possible... if I have to, I will use Javascript though.

Using Dreamweaver MX 2004 if that helps.

Anyone know how to do this?

Thanks,
Wintertide

TideMan
21-12-2004, 07:53 PM
For .css files, you just need Notepad. :)
They're text files with very simple format. :nerd:
Like this:
#header
{
background-color: orange;
border-bottom: 1px solid red;
color: white;
text-align: center;
}

wintertide
21-12-2004, 08:02 PM
I've got the sheets all set up and working fine... its just that it won't let me set it up so I can choose between the sheets when the page is loaded in a browser...

Wintertide

TideMan
21-12-2004, 08:13 PM
Sorry, I misunderstood you.
According to my bible (Cascading Style Sheets by Eric Meyer, OReilly), you can use alternate stylesheets by specifying rel="alternate stylesheet" in the link commands, then Mozilla, Netscape and Opera will allow the user to choose which style in View/Use Style. But for IE, you need to use JavaScript.

HTH

wintertide
21-12-2004, 08:17 PM
That's EXACTLY what i was looking for! Thanks a lot! I can always dig up the Javascript code for IE, but most of the people I know use Firefox anyways... ;)
[stops banging head on desk]

Wintertide

mejobloggs
21-12-2004, 10:04 PM
You can make a stylesheet switcher in php as well.

JimboJones
26-12-2004, 03:32 PM
ImageF1 and ChatF1 lets you choose styles... thats so cool:)