Can I add color to hyperlinked text in widget with CSS?

  • Unknown's avatar

    I’d like to color a few hyperlinks in my text widget so that they are the same color as hyperlinks in other places in my blog. Can someone show me code to do it, and that won’t change the color of all the text in my tex widget? :)

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

  • Unknown's avatar

    Hi there, you can surround the code for the links in text widgets with span tags with a style attribute such as below and set the color for individual links.

    <span style="color: #CC0000;">Link code here</span>

  • Unknown's avatar

    Can we look at something specific so I can get a better idea of what you’re trying to change?

    I looked at http://theshepherdschild.wordpress.com/about-belleweather-farm/current-happenings/

    And I see that links such as “Fiber Studio Visits” in the content on the left are a dark teal color (#205E5E) by default but if you have visited the link in the past the link will be a medium gray (#aaa).

    I see that the links in the sidebar on the right, such as “Camphill Village,” are a darker gray (#666).

    If you want the links in the sidebar to match the links in the content area exactly based on the current setup (including a different color for visited links), then you could add this to your Appearance > Customize > CSS editor:

    .front-widget-area .widget a,
    .sidebar-widget-area .widget a {
    	color: #205E5E;
    }
    .front-widget-area .widget a:visited,
    .sidebar-widget-area .widget a:visited {
    	color: #aaa;
    }
  • Unknown's avatar

    Thank you both, I’ll play with it.

    Does it really make a different color for visited links, I never noticed!? I have only just started adding links on the pages, and once I get them in place, I usually just use the editor at the top to make them teal. They’re not all done (lots isn’t done), I thought, so I thought that was why some are grey…. and that’s why I wanted the sidebar widget links to be grey!

  • Unknown's avatar

    Does it really make a different color for visited links

    It does!

  • The topic ‘Can I add color to hyperlinked text in widget with CSS?’ is closed to new replies.