View Single Post
Old 06-26-2008, 09:26 AM   #2 (permalink)
maZtah
The Acquainted
 
Join Date: Oct 2007
Posts: 170
Thanks: 18
maZtah is an unknown quantity at this point
Default

Personally, I would do it with css only.

Create an image with an anchor:
(The anchor is for the hovering, IE can only hover anchors)

HTML Code:
<a href=";"><img src="img.jpg" width="20" height="20" alt="" /></a>
Give the image a the same color border as the background (for instance, white):

Code:
a img { border: 2px solid #fff; }
Now to the hovering part:

Code:
a:hover img { border: 2px solid #000; }
As you can see, it works well in FF!

As usual, in IE this won't work, so you have to put a little 'hack' on the a:hover, like this:

Code:
a:hover { color: red; }
Now it works cross-browser without the picture moving!

Good luck.
maZtah is offline  
Reply With Quote