By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,676 Members | 1,759 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,676 IT Pros & Developers. It's quick & easy.

css referencing

P: n/a
Hi All,

Can anyone tell me if it's possible to accomplish the following:

a {
background:black;
}

b {
background:blue;
}

c {
background:green;
}

a,b,c {
color: white;
}
In a format such as:

a {
background:black;
color : foreground;
}

b {
background:blue;
color : foreground;
}

c {
background:green;
color : foreground;
}

foreground {
color: white;
}

TIA

~ Big Dog

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 3 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 2008-02-03, Big Dog <bi****@traxic.comwrote:
Hi All,

Can anyone tell me if it's possible to accomplish the following:
[...]
In a format such as:

a {
background:black;
color : foreground;
[...]
foreground {
color: white;
}
It's not possible.

Although there's nothing to stop you pre-processing your CSS with
something if you want, if you need that.
Feb 3 '08 #2

P: n/a
Thanks Ben!

I had a feeling that was the answer but wanted to get a definative answer
instead of spinning my wheels.

~ Big Dog

"Ben C" <sp******@spam.eggswrote in message
news:sl*********************@bowser.marioworld...
On 2008-02-03, Big Dog <bi****@traxic.comwrote:
>Hi All,

Can anyone tell me if it's possible to accomplish the following:
[...]
>In a format such as:

a {
background:black;
color : foreground;
[...]
>foreground {
color: white;
}

It's not possible.

Although there's nothing to stop you pre-processing your CSS with
something if you want, if you need that.


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 4 '08 #3

P: n/a
Big Dog wrote:
Hi All,

Can anyone tell me if it's possible to accomplish the following:

a {
background:black;
}

b {
background:blue;
}

c {
background:green;
}

a,b,c {
color: white;
}
In a format such as:

a {
background:black;
color : foreground;
}

b {
background:blue;
color : foreground;
}

c {
background:green;
color : foreground;
}

foreground {
color: white;
}

TIA

~ Big Dog

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
As far as I know no you can't. The format would be more like;
a { background-color: black;
the foreground color would be
color: white;
}

b {
background-color: blue;
color: white;
}

c {
background-color: green;
color: white;
}

and the foreground col0or would be color: white;

as in

body {
background-color: black;
color: white;
}

This would give a black background with white text. I don't know if this
is what you are looking for.
Feb 11 '08 #4

P: n/a
Jim Palsgrove wrote:
Big Dog wrote:
>Hi All,

Can anyone tell me if it's possible to accomplish the following:

a {
background:black;
}

b {
background:blue;
}

c {
background:green;
}

a,b,c {
color: white;
}
In a format such as:

a {
background:black;
color : foreground;
OP has "foreground" as CSS "variable"

<snip>
>
This would give a black background with white text. I don't know if this
is what you are looking for.

As Ben said. No. CSS does not have variables. Look up the "cascade" in
Cascading StyleSheets for how the cascade can work for you.

BTW No such groups on my server alt.html.css & uiuc.org.css

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Feb 12 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.