CSS For Changing Links?

Discussion in 'CSS' started by gobbly2100, Nov 21, 2007.

  1. #1
    Hey,

    When I want to adjust the color of links in a certain Class or ID how is the correct way to do this?

    Like this?
    #content a:link {
      color: #333;
    }
    Code (markup):
    or

    a#content:link {
      color: #333;
    }
    Code (markup):
    Thanks in advance!
     
    gobbly2100, Nov 21, 2007 IP
  2. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #2
    This one is the correct format for use of ID. If using class you would replace the # with a dot .
     
    kentuckyslone, Nov 21, 2007 IP
  3. gobbly2100

    gobbly2100 Banned

    Messages:
    906
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Could you tell me why it does not seem to be working here please?

    HTML
    <div id="below-footer">
    <p><a href="http://www.bluenotesolutions.com">Web Design</a> by Bluenote Solutions</p>
    </div>
    Code (markup):
    CSS
    #below-footer a:link{
        color: #333;
    }
    Code (markup):
    I am trying to adjust it on my Music site but just not playing ball :(
     
    gobbly2100, Nov 21, 2007 IP
  4. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #4
    Do you have a style set for the <p>? If so then it may be over riding your settings for "below-footer"
     
    kentuckyslone, Nov 21, 2007 IP
  5. gobbly2100

    gobbly2100 Banned

    Messages:
    906
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes I do have a style set for that ID so I have had to simply add class tags to all my links instead.

    I assume there is no way of doing it how I wanted then?

    Thanks for your help!
     
    gobbly2100, Nov 21, 2007 IP
  6. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #6
    Yes, I am sure that there is a way to do it, but I dont fully understand what you have here. If the snippet you have shown resides within another div that has a style sheet setting for <p> it may be that this is what is causing it knock to work as expected.
     
    kentuckyslone, Nov 21, 2007 IP
  7. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #7
    #below-footer p a:link{
    color: #333;
    }

    Thats your answer, but it would be a million times better if you showed us the page.
     
    Crimsonc, Nov 21, 2007 IP
  8. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #8
    Yes, that would work for you
     
    kentuckyslone, Nov 21, 2007 IP
  9. gobbly2100

    gobbly2100 Banned

    Messages:
    906
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Well I have sorted the issue now but if you are still interested in knowing how I got around the problem then here is the link Artist Management

    Thanks!
     
    gobbly2100, Nov 22, 2007 IP
  10. ebookworld

    ebookworld Banned

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    ya show us the page
     
    ebookworld, Nov 23, 2007 IP
  11. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #11
    ebookworld, he said he already figured it out - there's no need to see the page now ;)
     
    Dan Schulz, Nov 23, 2007 IP