Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you make the underline mouseover on a link

Status
Not open for further replies.

fishin4snook

IS-IT--Management
Sep 20, 2000
83
US
How do you make the underline mouseover on a link so that when the mouse isn't over it theres no line and then when the mouse is over the link there is a line?
 
Well, you can just add to the onMouseOver event handler:

Code:
<a href=&quot;mailto:benbiddington@surf4nix.com&quot; name=&quot;one&quot; ;
      style=&quot;text-decoration:none&quot;;
      onMouseOver=&quot;document.links[0].style.textDecoration='underline'&quot;;
      onMouseOut=&quot;document.links[0].style.textDecoration='none'&quot;>
      benbiddington@surf4nix.com</a>

Aplogies for the formatting, but you get the idea, the main points:

-- Must access links thru index of links array.
-- If using for an anchor use the anchors array instead of links

You can also use classes, which is much better, since then every link on the page will behave this way, let me know if you want to do this and I will dig up some code for you.

hope this helps, Ben
 
IE 4 and up has a psuedo class 'hover' for anchor styles that can do that for you:

A:hover{
text-decoration: underline;
}

Good luck
-pete
 
and if you use petes you should add this line to the style definition as well:

A {text-decoration:none;} jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top