homepage Welcome to WebmasterWorld Guest from 174.129.163.183
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

CSS Forum

    
Classes in classes (CSS)
Defining Colors and Controlling Stylesheets
Filipe




msg:1186440
 3:21 am on Aug 29, 2002 (gmt 0)

Is there a way to make a variable definition of a value for use in a styles? e.g.,

I have a site that I essentially only want to use 6 colors on. I want to set those colors at the head of my stylesheet, and then use those definitions throughout my stylesheet. Here's a pseudocode version of what I'm talking about:

<style>
color1 = red
color2 = orange
color3 = yellow
color4 = green
color5 = blue

H1 {color: color1;}
H2 {color: color2;}
BODY {color: color2;}
TD {color: color3;}
</style>

Since the same color will be used throughout the stylesheet, I'd much rather be able to change the color values at the top rather than having to change them throughout the document. Makes it easier to maintain uniformity.

 

mdharrold




msg:1186441
 4:25 am on Aug 29, 2002 (gmt 0)

Two ways to do it:

1) include a script that will output the styles into the <style> section of each page
2) redesign the site using PHP and do the same as above

tedster




msg:1186442
 4:29 am on Aug 29, 2002 (gmt 0)

That would be a very nice extenion of pure CSS. Maybe someday.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved