+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linking Color In CSS

    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.)

  2. #2
    Junior Member
    Join Date
    Apr 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  3. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  4. #4
    Junior Member
    Join Date
    Jan 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  5. #5
    Junior Member
    Join Date
    Aug 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  6. #6
    Newbie
    Join Date
    Aug 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i actually learn an advance CSS very useful..

    _________________
    Indianapolis seo

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBulletin® Version 4.1.9
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.0
Copyright 2011 Photoshop Gurus Forum. All rights reserved.
All times are GMT -5. The time now is 07:47 PM.
vBulletin Skins