问题描述:

In Firefox, whenever a link is clicked, there is a dotted outline around the item.

Is it possible to modify it so that I can select the div that is being highlighted, or customize the area that it outlines?

网友答案:

In CSS:

a:active{outline:0;border:(customize the border around the active link)}

For a div (using JQuery):

$(function(){ 
    $('div#your-id').click(function(){ 
        $(this).css({'enter the CSS rules for the div here'}); 
    }); 
});

http://docs.jquery.com/CSS/css#name

网友答案:

I think you will want to check out Removing Dotted Links.

If you want to retain the dotted border for tab-based navigation, apply this to a:active. This still allows the indicator to appear when focused by keyboard, but hides when mouse activated:

a:active
{
    outline: none;
}

For all links:

a
{
    outline: none;
}

For Mozilla-based browsers only:

:focus
{
    -moz-outline-style: none;
}

That only answers half your question though. To change the area the dotted outline outlines, you'll probably have to write some JavaScript to change the border or outline of the element you want to outline based on the click event of the link.

网友答案:

Css:

:focus {outline:none;}
::-moz-focus-inner {border:0;}
相关阅读:
Top