Is it possible to have a border around an image which is a link via CSS, so that when I hover over the image a border appears around the image? I would like a 5px thick border around every image which is a link, yet I'm not able to get it done quickly :( Any help would be greatly appreciated.
+4
A:
If you don't want the content to jump around, you would want to make room for the border when the images are not hovered:
a img { padding: 5px; }
Then replace the padding with border:
a:hover img { padding: 0; border: 5px solid red; }
Guffa
2010-07-19 23:09:43
Or use `outline` instead of `border` which doesn't take up space.
Joey
2010-07-19 23:15:18
awesome, just the right combination to get it working TY!!!!!!!!!!
HollerTrain
2010-07-19 23:16:56