SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Different link colors

    I was wondering how I can apply both an external and and internal css with a pseudo class to an element at the same time? I know I can't put two "Class" tags inside one Table Data tag. How do I do it then? I'm trying to get different link colors in my document and the browser is not cooperating. I found code to apply the pseudo class to different areas in order to achieve different color links but the problem was the elements were already formatted with an external style sheet. I figured that this was ok since they are "Cascading" and I can just apply the pseudo class and overide the outside tags. Can someone give me the low down on pulling off this technique and best practices. I'm totally lost here. I don't know if I'm on the right track.

  2. #2
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so what exactly are you trying to do......

    Just tell me what you want to achieve and that will be easier.......

    If you want different link colors, you could define different classes for each........

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The skinny

    I simply want to make several different link style attributes on the same page using external CSS and have it work in all post World War II browsers. Must I use internal? This is the only way I can find. I would give the shirt off my back to make one link blue with a "visited" darker blue and another link black with a "visited" Dark Grey all on the same page. I'm on my second lifeline now. I already phoned a friend and now I'm polling the audience. Perhaps you can give me several answers and I can take away the two that don't work for me. Thanks in advance for the CSS and Comedy advice.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    Penns Woods
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink De Colores

    /* Stylesheet external.css in the same directory */
    #one { color:#000000; background-color:transparent }
    #one a:link { color:#4e4eff; background-color:transparent; text-decoration:none }
    #one a:visited { color:#0000ff; background-color:transparent; text-decoration:none }
    #one a:hover { color:#00904f; background-color:transparent; text-decoration:underline }
    #two { color:#000000; background-color:transparent }
    #two a:link { color:#000000; background-color:transparent; text-decoration:none }
    #two a:visited { color:#9d9d9d; background-color:transparent; text-decoration:none }
    #two a:hover { color:#ff0000; background-color:transparent; text-decoration:underline }

    <html>
    <head>
    <title>De Colores</title>
    <link rel=stylesheet type="text/css" href="./external.css" />
    </head>
    <body>
    <div id="one">Here's a sample <a href="http://www.gnukazoo.com">link</a> in a div.<br />
    <span id="two">Here's the same <a href="http://www.gnukazoo.com">link</a> in a span within the div.</span>
    </div><br />
    Background-color:[option] needs to be included if you want valid CSS.<br />
    List a:hover last if you want to get the hover effect on a visited link.
    <!-- What kind of shirt is it? -->
    </body>
    </html>
    Last edited by tryangle; Jul 25, 2002 at 17:27.
    // PS! My brain just hit a bad sector...

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok that's some freaky message changing crap you just pulled Tryangle. I caught that shirt shift. For your information It's a shirt that sais "Skills needed....apply in front". Thank you for the info. I think I might just make a new shirt that sais "I love Tryangle". Kinda like I Yahoo but different. Lata

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    Penns Woods
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External Style Sheet

    Hi,

    I changed my post because I realized that you wanted it in an external style sheet, so I thought it would be better to reflect that.

    You asked for Comedy Advice, what did you expect?
    I'm NOT at all interested in your shirt anyway.

    Lighten Up.
    // PS! My brain just hit a bad sector...

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink

    You must have mistook me for one of those uptight people. I'm as easy going as shaggy. Thanks for the change over to external. I think the # signs would have blown up coldfusion if it was held within the document.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •