473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

css referencing

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
4 1886
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: xcomm | last post by:
Hi All, <?php $vars= array("_SERVER","_SERVER","_SERVER","_SERVER","_SERVER","_SERVER"); foreach($vars as $var) { if(isset($$var))echo("$var: ${$var}<br>\n"); } ?> php.net:
1
by: student | last post by:
while compiling on: SunOS 5.8 Generic_108528-27 sun4u sparc SUNW,Sun-Fire-280R I get the following error: Undefined first referenced symbol ...
2
by: sreddy | last post by:
I am trying to write a sql query on self referencing table. Just to brief ..Database is related to a Hiring department of the Qwest company. I need to generate a Report used by in HR...
2
by: Simon | last post by:
Am using the following code. <script language="JavaScript1.2"> function setquantity(productindex,productquantity) { //create the reference object irefname_none = eval("document." +...
6
by: jstaggs39 | last post by:
I want to create a Dcount and an If...Then...Else statement to count the number of records in a table based on the date that is entered to run the form. The If....Else statment comes in because if...
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
9
by: Brett Romero | last post by:
Say I have a library (A.dll) with a method that accepts a collection of a specific type. The type is defined in B.dll. In A.dll, I need to loop through this collection and reference fields of...
1
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.