Links That Aren't Underlined

Before we discuss how to set links so that they aren't underlined, it's worth considering for a moment if it's really such a good idea. Users of visual browsers such as MSIE and Netscape have their eyes trained to spot links by the underline. If you take away those underlines you're more likely to confuse your readers than to enhance the page. Still, there are a few situations where it makes sense to take out the underlines. For example, if your page is practically nothing but links then it is less visually crowded without the underlines. Before you set the links to have no underline, try it out first as normal, then decide if it's really improved by changing it to something that your readers don't expect.

To remove the underlines from all links, put this code in the <HEAD> section of the document:

this code produces this
<STYLE TYPE="text/css">
<!--
A {text-decoration:none}
-->
</STYLE>
this page

If only a part of your document should be without underlines in the links use a styles class. Use the same code as above, but add .nounderline before the A:

<STYLE TYPE="text/css">
<!--
.nounderline A {text-decoration:none}
-->
</STYLE>

Then you can use the class in any section of the document. For example, this code uses <DIV ...> and the nounderline class:

<DIV CLASS="nounderline">
<UL>
<LI><A HREF="nounexatarget.html" TARGET="_top">this is a link</A>
<LI><A HREF="nounexatarget.html" TARGET="_top">this is another link</A>
<LI><A HREF="nounexatarget.html" TARGET="_top">and this is yet another link</A>
</UL>
</DIV>

which gives us this:





About the Author
Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.