Image link border on click

greg's picture

He has: 1,581 posts

Joined: Nov 2005

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's picture

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's picture

He has: 1,581 posts

Joined: Nov 2005

decibel.places wrote:
<style>
img {border: none;}
a {outline: none;}
</style>
Cheers, "outline: none" worked a treat!

decibel.places wrote:
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.
Why do people think internet users are lame monkeys? I know a certain level of help and assitance is required, as is making things as easy as possible, but there has to be a line drawn somewhere.
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? Whistle

decibel.places's picture

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:

Google in morse code with outline

(Samuel Morse's birthday)

greg wrote:
Or should I perhaps use Drupal for this? Whistle

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? Confused

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.