html class problem

Discussion in 'HTML & Website Design' started by softstor, Nov 30, 2005.

  1. #1
    Look at the following two examples:

    [A class="snip" href="site.com"]test1[/A]

    [DIV class=snip]
    [A href="site.com"]test2[/A]
    [/DIV]


    Please Note: <> was replaced with [] to show correctly in this message.

    I am trying to get the hyperlink a specific color. In test1 it works correctly. But in test2 it does not work. Is it possible to get the hyperlink a specific color without changing the [A href="site.com"]test2[/A] line?
     
    softstor, Nov 30, 2005 IP
  2. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You would have to account for both cases in the selector.
    DIV.snip A, A.snip {
        color: whatever;
    }
    Code (markup):
    Edit
    Edited the above code. Forget to add the .snip onto the A as well.
     
    FeelLikeANut, Nov 30, 2005 IP
  3. softstor

    softstor Active Member

    Messages:
    782
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks, that worked!
     
    softstor, Nov 30, 2005 IP