Link color conundrum

  • Unknown's avatar

    Hello. I want to make link and visited colors the same in Twenty Ten theme but my attempt to do so caused all meta links – date/author and category/’comment’ – to turn that same color. I wanted those to remain the same default grey.

    How can I add CSS that only makes the desired change to post and sidebar links?

    This was the CSS I used:

    a:content-link {
    color: #0066cc;
    }
    a:visited {
    color: #0066cc;
    }
    a:hover {
    color: #ff4b33;
    }

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there,

    Your current CSS code above targets all the links on your site.
    You need to target specific links hence use the classes or ids to target the specific area/ elements
    For example, for links in the sidebar /widget area

    .widget-area a:link {
        color: darkred;
    }

    that seems to work to target just those links

    And then for the post tittles

    .entry-title a:link {
        color: indigo;
    }

    you can then add your code for hover, visited, etc but it’s important to make sure you are using a specific class or id for the targeted areas so that you don’t make sitewide link changes.

    I hope this is helpful. Let us know if you need further assistance

  • Unknown's avatar

    Thank you. Very helpful re sidebar.
    Much appreciated.
    What is the correct CSS class code for hyperlinks added to posts by me?

  • Unknown's avatar

    Hello

    Please try adding the below code:

    .single-post .entry-content a{
    color:#f00;
    }

    Let us know if that helps.

    Regards:

  • Unknown's avatar

    Thank you.
    The visit color of the small navigation links – date/author and category/’comment’ – are still being changed.

    That is: my code above isn’t changing the color of those links (yay) EXCEPT after visit (boo).

  • The topic ‘Link color conundrum’ is closed to new replies.