This is just the way I do it, there is plenty of other ways.
This is the easyest. When you get into JavaScript or web design in general you'll notice IE is a bitch, especially when you get into DOM/AJAX/DHTML.
This code works in IE 6 (proberly 4 and 5 too), Firefox and i'm pretty sure Opera too but I haven't tested it yet as Opera is a pretty good standard complient browser but with a very small user base.
Code:
<link id="CSSElement" type="text/css" rel="stylesheet" media="all" href="styles.css" />
function StyleSheetSwitch(CssUrl)
{
document.getElementById('CSSElement').href = CssUrl + '.css';
}
Give your link tag an Id attribute and set that to "CSSElement". Then create a few links;
Code:
<a href="javascript:;" onclick="StyleSheetSwitch('styles_red');"
When clicked the onclick attribute triggers the function 'StyleSheetSwitch' which then finds the link tag and changes the href attribute.
Tip; use document.write to add the CSS swapping links so if the user doesn't have JavaScript enabled, the page doesn't have broken links.
Note;
<
a href ="
index.html"></a>
a = tag
href = attribute
index.html = value