You can use PHP to dynamically generate a style sheet to control just the elements you need to colour. You can probably use ASP but I'm not an ASP person.
There's a couple of articles at http://codewalkers.com/tutorials/75/1.html and http://www.barelyfitz.com/projects/csscolor/ which show style sheet generation with PHP.
In your normal style sheet you have the default definition e.g.:
Code:
.random {
width: 300px;
height: 300px;
}
Then after you've included the default style sheet include the dynamic one with:
Code:
<link rel="stylesheet" type="text/css" media="screen" href="style.php" />
The style.php is:
Code:
<?php
header("Content-type: text/css");
switch(rand(0, 2)) {
case 0:
?>
.random { background-color: #f00; }
<?php
break;
case 1:
?>
.random { background-color: #0f0; }
<?php
break;
case 2:
?>
.random { background-color: #0f0; }
<?php
break;
}
?>
Then in the HTML simply assign the .random class to the element to style randomly. I've only changed the background colour but you can change any property and also change many classes at once with this method.
If you use this method don't put all your styles in the PHP, only put what you have to as the PHP style sheet won't be cached by the browser.
If you don't have server side scripting support then you can use JavaScript to change the styling on elements, if you do this you need to ensure that the default style looks reasonable for people who run with JavaScript disabled.