Make Link Text Color Different from the Link Underline Color
by Emma Dobrescu - August 18th, 2006 12:35 pm
Sometimes when you code a page you might want to have one color for the link and a different color for the underline.
There’s a simple solution to that. You need to add a span inside the link, span that will contain the actual text of the link:
<a class="link" href="http://www.ecommercepartners.net/blog/wp-admin/yourlink.com">yourlink.com</a>
Now in the css you will apply one color for the “a” element and another color for the span:
a.link {
color:#FF0000;
text-decoration: underline;
}
a.link span {
color:#000000;
}
And your link is good to go with a brand new underline.Of course you can have a few variations of that playing with the hover states.
Related posts:
- one link at a time A few years ago I wrote an article for a...
- Welcome to the World Wide West – What color is your hat? I miss the days depicted in those old westerns. You...
- Spider Getting in the Loop I was attempting to create ROR Sitemap for Ecommerce Partners...
- Is Internet Explorer (IE) Crashing, but not Firefox? Here’s a possible fix… CSS Styles that Crash in IE but not FireFox Recently...
- Don’t Playa Hate on AOL Don’t hate the playa’ hate the game, is how it...
