Changing The Colour Of The Underline In A Link

You learn something everyday when designing websites. I have finally worked out how to display a link with the same colour font, but different underline.

The code is simple, the following displays the link in blue and underlined:

<a href=”URL”><span class=”blue”><u>Anchor Text</u></span></a>

The following code will display the link the same colour font as the paragraph, but the span controls the colour of the underline:

<span class=”blue”><u><a href=”URL”>Anchor Text</a></u></span>

This is because the span and underline is outside of the link.


Leave a Reply

Your email address will not be published. Required fields are marked *