views:

38

answers:

4

I have the following code:

$('a.btn-slide').toggle(function() {
    $("#SliderDIV").slideDown("fast");
    $(this).text('Hide/Show');
});

Only in Firefox, when I click the a href link to hide/show the DIV, Firefox display a dotted border around the href link (which I don't understand why and it shouldn't be).

However, in IE and Chrome, when I toggle the link - it does not create this strange border around the link.

A: 

I think you are talking about the outline property. It is generally an annoying thing. you can set it off in your master stylesheet like this:

* {outline:none;}
XGreen
eek, this will remove outlines on every element.. this could create unwanted problems - since the issue at hand is simply active links, it might be better to restrict this to the active link..
Rabbott
can you explain what kind of problem it causes?
XGreen
This is a bad idea. The outline tells you what element is focused, and it's a very important usability feature.
meagar
the fact that this cascades to ALL elements..
Rabbott
+1  A: 

Thus, you want to get rid of the dotted outline?

Just do

a {
   outline: none;
}

This however impacts users with keyboard navigation. They won't be able anymore to figure which link they've tabbed now.

BalusC
A: 

I believe that you are talking about the dotting border that appears after a link is clicked.. it is annoying haha but here is what I've used in the past to fix it

http://sonspring.com/journal/removing-dotted-links

a:active {
  outline: none;
}

This way you are being specific to your links, and avoiding any issues with other css elements.

Rabbott
A: 

Add outline: none !important to the element's CSS.

SLaks
! important should be reserved for disabled users so they can over ride the your css settings. there is always a way in the inheritance hierarchy to avoid using !important
XGreen