Anchor Tag Navigation Styling - Need Help

Discussion in 'Web Design and Development' started by thinkpatience, Jun 30, 2012.

  1. thinkpatience macrumors member

    Joined:
    Jun 28, 2009
    #1
    Hi all,

    I've designed a single page website with smooth scroll jquery, the header + nav is fixed to the top of the website with anchor tags as the link. So the page travels up underneath the #header with a z-index:9999 set.

    Everything functions great, I just need to know how to make the navigation links look a certain way (i.e. line underneath, different color, etc...) when you are on its corresponding page and/or at their anchor tag.

    Can this be accomplished through CSS or do I need to use JQuery? Hopefully it's just a simple CSS solution that I'm blanking on...

    Thanks!
     
  2. Hexiii macrumors 65816

    Hexiii

    Joined:
    Jun 30, 2011
    Location:
    Prague, Czech Republic
    #2
    Try

    a:active {
    color: xxxxxx;
    text-decoration: underline;
    }

    Is this what you need?
     
  3. thinkpatience thread starter macrumors member

    Joined:
    Jun 28, 2009
    #3
    Hmm, tried it... it just makes the link underlined when it is clicked until you release the mouse. I'd like it to stay while on that page/anchor.
     
  4. Hexiii macrumors 65816

    Hexiii

    Joined:
    Jun 30, 2011
    Location:
    Prague, Czech Republic
    #4
    Well, there is no just CSS solution for this, you're going to need some JS. :/
     
  5. thinkpatience thread starter macrumors member

    Joined:
    Jun 28, 2009
    #5
    Ahh, that's what I was thinking... thanks for the help though.
     
  6. Hexiii macrumors 65816

    Hexiii

    Joined:
    Jun 30, 2011
    Location:
    Prague, Czech Republic
    #6
    I would help you further if I knew how to JS.

    Try to google something or post your website here so people can look at the code directly.
     
  7. Hexiii macrumors 65816

    Hexiii

    Joined:
    Jun 30, 2011
    Location:
    Prague, Czech Republic
    #7
    Did you see this thread? It seems it's the same question.

    http://forums.macrumors.com/showthread.php?t=1394686
     
  8. AFPoster macrumors 65816

    Joined:
    Jul 14, 2008
    Location:
    Charlotte, NC
    #8
    post a link to the site so we can view your creation and give better advice by looking at the source.
     
  9. clemsonhomerun macrumors newbie

    Joined:
    Jul 11, 2009
    #9
    i concur, hard to diagnose this stuff without the url. Could be any number of things causing the css to not show as desired.
     

Share This Page