Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Design Set active link text color

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #270126
    dutch
    Participant

    I’m having trouble setting text color on active links. I’ve put up a very simple example at my site. When you hover, the text turns to white and the background to orange, as specified in my css. But I want the active state to keep that same color scheme: White text on orange background. I thought I’d specified that, too, in my css, but it’s not keeping the text white.

    Any thoughts appreciated!

    Dutch

    #270128
    Beverleyh
    Participant

    The .active class you’re using is applied to the li element, so to override the existing child a styling, you’ll need to use something like .active a {} for your selector – to target the anchor rather than the list item.

    Note that a CodePen demo is preferred here so that we can more easily test our suggestions (you’ll attract more responses). The above isn’t tested – it’s just a guess. You may have to increase specificity by using #nav .active a instead.

    #270129
    dutch
    Participant

    Thank you, Beverly; I’ll experiment with those solutions.

    I loaded the example at my site because I couldn’t figure out how to set up a multi-page example on CodePen.

    I appreciate your help,
    Dutch

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design’ is closed to new topics and replies.