views:

47

answers:

2

Weird question I think its more of I am not sure what it is called. But I have an img wrapped in an link

example

...<li>
  <a href="#link">
    <img ...>
  </a>
 </li> .....

Now I have the css border rules all to 0. So their is no Blue border. But in Firefox their seems to be a pink mini dashed border only when I click on the image? In other browsers there is no border at any time. Im not sure if its from the browser itself or something I am missing. In my css I have border set to 0 on the a,:hover,:visited I even put text-decoration to none thinking that might help. But to know avail. I tried searching online for help but all I get is info on removing the border caused from placing the image in the link. So any help or a point in the right direction would be great. ! edit// I added a picture to better explain what I am talking about. alt text

+7  A: 

Links (<a>’s) by default have a dotted outline around them when they become “active” or “focused”. In Firefox 3, the color is determined by the color of the text

To remove it, simply use:

a {
    outline: none;
}

Or you can do what I do, and remove it from all elements (I use my own focus/active rules) and do

* {
    outline: none;
}

This will remove it from all elements.

Marko
True. It will however affect usability and accessibilty. Keyboard navigation will be harder. The `outline` will namely be shown when you're tabbing through links. Rather consider giving it a less disturbing color using [`outline-color`](http://www.w3schools.com/Css/pr_outline-color.asp) property.
BalusC
I agree, hence why I said using my own focus/active rules :) Outline isn't enabled by default in IE, so when tabbing through fields I change the background color or border color in the :active state.
Marko
Oh, that part of the answer wasn't there when I saw your answer for the first :)
BalusC
Oh well that makes sense :) Thanks for the heads up anyway!
Marko
the outline:none; worked thanks thats what I was looking for. But I get what your saying Balus and I think I might just do it your way. On a side note. If I kept it at outline: none to the links with the imgs in it. Does tabbing through still go on through them but your just wont see it?
Tad
You just won't see them.. removing the outline property won't affect tabbing, you just won't know what element you're on. As mentioned above, you could use the a:active/a:focus state and set a different background image, text color, border or anything else that tickles your fancy :)
Marko
You might want to use a different background image with a slight different font color for `a:focus`.
BalusC
Oh and @BalusC - thank you for assisting the answer, I would give you half the points if I could :)
Marko
Those are both great ideas! Thanks for the tip. But from what I though was that A:active is not used in firefox? Or am I thinking of something different?
Tad
A: 

Install Firebug and see what's going on. I think what's going on is img tag probably has a default border.

To remove it maybe you can try putting your a and img tags inside of a div with an id and using following CSS:

Your HTML:

<div id="test">
  <a...>
  <img .../>
  </a>
</div>
And use the following CSS:

#test img { 
  border-style: none; 
}

Sharvil
Already got it working already but thanks. The borders were already set to 0 it was caused by the css property outline
Tad