471,603 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Reuse some existing css value?

Hello,

Consider I have a background-color set to red, e.g.

#header { background-color: red }

This value is a variable - can be changed by user

I want the footer to also use this value, something like e.g.

#footer {
background-color: {$header_background_color}
}
besides using script such as PHP, is it possible to do this in pure
css?

thanks.

Sep 7 '07 #1
1 2372
howa wrote:
Hello,

Consider I have a background-color set to red, e.g.

#header { background-color: red }

This value is a variable - can be changed by user

I want the footer to also use this value, something like e.g.

#footer {
background-color: {$header_background_color}
}
besides using script such as PHP, is it possible to do this in pure
css?
No CSS does not have variables. You can do

#header, #footer { background-color: red; }

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Sep 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by DPfan | last post: by
1 post views Thread by Bob Dufour | last post: by
8 posts views Thread by Edward Diener | last post: by
19 posts views Thread by jacob navia | last post: by
8 posts views Thread by WebSnozz | last post: by
6 posts views Thread by Bart Simpson | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

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.