What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Linking Color In CSS


skoz55

Member
Messages
17
Likes
0
I have a standard CSS file that I simply edit for the next site I'm building. I'm trying to figure a way to link an individual color to multiple selectors in the CSS.

For example, let's say I have 3 primary colors I'm using and they are being shared between fonts, backgrounds, tables, etc. Thus there could be 30 different places calling out the color code in one style sheet. If for some reason I need to adjust the colors, I must edit every line in the CSS with that color code (30 times).

I'd like to setup the three colors in their own selectors. Then reference the fonts, backgrounds, and tables to those colors. All in the CSS. This way I can easily adjust the three color syntaxes and have all the pages update.

Any thoughts on this?

(And I do realize I can do a find/replace all to change the color codes.)
 
Messages
22
Likes
0
I have a web page with some background areas that are dark and need a light colored font for links within that section, but I also have some areas that have a light background and need a dark colored link within the light background, how do I have more than one link color?
 

skoz55

Member
Messages
17
Likes
0
You would assign different elements to the links and then assign the different font colors via CSS. If you're not familiar with CSS, there are tons of tutorials online. Just google it.

One particular site that I often reference is CSS Tutorial
 

skoz55

Member
Messages
17
Likes
0
I now see that you associate with a web development company, thus are probably pretty familiar with CSS. I must be not understanding the question. Can you elaborate?
 

jamison777

Member
Messages
5
Likes
0
you can use multiple selectors seperated by commas

td, .class1, #id1 { background: #fff; } /*define a background for certain selectors*/
h3, .normal, #id2 { color: #000; } /*font color*/

etc.

this is the most centralized you can probably get it.
 

Top