I'm working on a site that has a three color scheme. Each of the colors is used in several elements. Unfortunatly, the three colors keep changing as the design is refined. Is there a way to asign a color a name and use it that name instead of #NNNNN?
If you have PHP enabled you can set variables in your stylesheets. I know of some blogging systems that do this. Say you wanted #444444 to be set as darkgrey you could do $darkgrey = '#444444;'; and you could use the syntax like this in the CSS
color: <?php $darkgrey ?>
color: <?php echo $darkgrey; ?>
I THINK! If not let me know.
looks right to me. Using PHP is stylesheets takes a bit of a hack on my server to get them to return as "text/css." I was hoping that css had this function built in.
How do you make your server accept css as php? I suppose it has something to do with MIME or apache handlers, but I've never messed with those before.
<?php header('Content-type: text/css'); ?>
That will send the correct mime type for a css document with a .php extension.
So if I get it right, I rename my file to style.php, and I put your code at the beginning.
In my html files I put this:
<link rel="stylesheet" type="text/css" href="style.php" />
Yep, thats the one. Should work just fine, I actually tried it last week and it was all good. Works on every browser I've tested it on.
thanks a lot! I'll start making some intelligent css sheets :idea: