This is a rudimentary solution, it won't handle addition of classes, just replacements based on your path.
Create two directories, one called 'red', one called 'blue'. Create pages in each with the following in them. They will read the path and add the class into the DIV called #content.
Here's a Fiddle (note: with a hardcoded path so it works) to demonstrate.
Hope this helps.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.red {background-color:red}
.blue {background-color:blue}
.green {background-color:green}
</style>
</head>
<body>
<div id="content">this is the content</div>
<script type="text/javascript">
var locationpath = ""+window.location.pathname+"";
var options = ['red','blue','green'];
for (var i =0;i<options.length;i++) {
if (locationpath.indexOf(options[i])>0) {
document.getElementById('content').setAttribute('class',options[i]) ;
}
}
</script>
</body>
</html>