Image link border on click
I have a link image, nothing special - <a href><img></a>
- but when it's clicked there is a border around the image, which happens to be the default A:link colour I have set in the stylesheet.
How do I get rid?
I have a link image, nothing special - <a href><img></a>
- but when it's clicked there is a border around the image, which happens to be the default A:link colour I have set in the stylesheet.
How do I get rid?
decibel.places posted this at 00:06 — 27th April 2009.
He has: 1,494 posts
Joined: Jun 2008
<style>
img {border: none;}
a {outline: none;}
</style>
works except in IE, of course
(actually, it works in my IE7 installation, but not in my EditPlus preview in IE...)
apply a dhtml trick to the anchor tag for IE:
<a href="http://www.webmaster-forums.net/html-css-and-javascript/" onfocus = "this.blur()"><img src="http://www.webmaster-forums.net/files/pictures/picture-1018260.png" /></a>
HOWEVER, some UE experts consider the image outline to be useful feedback for the user, showing that the image link is active or at least selected, so they do not recommend removing it.
Depends on your situation.
greg posted this at 03:36 — 27th April 2009.
He has: 1,581 posts
Joined: Nov 2005
<style>
img {border: none;}
a {outline: none;}
</style>
And people click buttons all the time.
Anyway, the images are in a nav menu, and I have 3 image states anyway: hover, active and current.
Cheers
Or should I perhaps use Drupal for this?
decibel.places posted this at 03:12 — 28th April 2009.
He has: 1,494 posts
Joined: Jun 2008
I just happened to notice that on Google's home page they do not bother to remove the outline on the logo:
(Samuel Morse's birthday)
Why all the Drupal bashing? Did I mention it on this thread?
However, it appears that TWF - using Drupal - has already removed the borders AND outlines on a linked image, is that a custom setting or default?
There! Happy?
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.