#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    2
    Rep Power
    0

    css - link color in table


    Hi

    I have a css file stating the following:
    A:link { color: #71828A }
    A:visited { color: #71828A }
    A:active { color: #71828A }

    ... of course this is applied to the whole page.
    I would like to set different link colors inside table data:

    #BottomTable TD
    A:link { color: #CCCCCC }

    ... but this doesnt work! Any ideas, please?
  2. #2
  3. Java PHP Oracle Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    C-Bus OH-IO
    Posts
    204
    Rep Power
    11

    Contextual Style


    From http://www.yourhtmlsource.com/styles...vancedcss.html

    Contextual style is a powerful technique that can save you from having to define too many classes. You can have your stylesheet apply CSS rules to an element, depending on what other elements it is contained in. For instance, if I wanted all bold tags that are contained in paragraphs to be red, I could write:

    p b {color: red; }

    You just list the selectors (which can be tags, classes or ids) in descending order, with single spaces between them.

    The following will work in your situation:

    A:link { color: #71828A }
    A:visited { color: #71828A }
    A:active { color: #71828A }

    td A:link { color: #CCCCCC }
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    2
    Rep Power
    0
    Thanx for your help

IMN logo majestic logo threadwatch logo seochat tools logo