Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / June 2003



Tip: Looking for answers? Try searching our database.

A variable for a property value to use in several declarations?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kent K - 29 Jun 2003 05:14 GMT
Is is possible to, in a linked css sheet to define a variable and
assign the color blue, for instance to it?  Then you could use this as
the value for say, any property that takes a color.
I know you can do:

h1, h2, h3, h4 {color:blue}

to define the color blue for all those tags but I want to use the same
color for the "color" property, the "background" property, the
"border-color" property, etc.  So if you could define a variable for
this color, then you could just insert it instead of the value "blue"
in each of the property's value parameters.  Then when you wanted to
change the color you could just change it where you defined the
variable.

I've looked alot but can't find anything on this but would think this
would be possible?!?

Thanks in advance,

Kent
Jukka K. Korpela - 29 Jun 2003 07:32 GMT
> Is is possible to, in a linked css sheet to define a variable and
> assign the color blue, for instance to it?  

No. And there probably won't be, as judged from the discussions on the
www-style list. The general trend among the people who work on CSS
specifications is that authors are supposed to use authoring tools like
preprocessors for such things.

Signature

Yucca, http://www.cs.tut.fi/~jkorpela/

Bertilo Wennergren - 29 Jun 2003 11:02 GMT
Jukka K. Korpela:


>> Is is possible to, in a linked css sheet to define a variable and
>> assign the color blue, for instance to it?

> No. And there probably won't be, as judged from the discussions on the
> www-style list. The general trend among the people who work on CSS
> specifications is that authors are supposed to use authoring tools like
> preprocessors for such things.

One convenient way is to use PHP (or some similar server side system) for
stylesheets (making sure the PHP code sets the correct media type, of
course).

Signature

Bertil Wennergren <bertilow@gmx.net> <http://www.bertilow.com>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.