5416339
5416339

Reputation: 417

How to remove the "Dotted Border" on clicking?

As you can see

alt text

I want to somehow remove the dotted lines after the button has been clicked.Any ideas how ?

Thanks

GUYS : This is the current status of my CSS ansd HTML but still no USE:

.myButton input {
position:absolute;
display:block;
top: 5%;
left:87%;
height: 44px;
border:none;
cursor:pointer;
width: 43px;
font: bold 13px sans-serif;;
color:#333;
background: url("hover.png") 0 0 no-repeat;
text-decoration: none;
}
.myButton input:hover {  
background-position: 0 -44px;
color: #049;
outline: 0;
}
.myButton input:active {
background-position: 0 -88px;
color:#fff;
outline: 0;
}

input:active, input:focus {
      outline: 0;
}

<div class="myButton">
<input type="submit" value="">
</div>

Nothing seems to be happening !!

Upvotes: 11

Views: 16237

Answers (6)

bibaso
bibaso

Reputation: 11

If you want to keep the outline on active and on focus, but hide it on clicking a link, you can add in css:

A.No-Outline {outline-style:none;}

and use script:

$('A').hover(function() {
    $(this).addClass('No-Outline');
},function() {
    $(this).removeClass('No-Outline');
});

you must be hover befor clicking, so it does the job.

Upvotes: 1

kobe
kobe

Reputation: 15835

use the below code

a:active
    {
    outline: none;
    }

try for other browsers also

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

Upvotes: 6

Shadow Wizard
Shadow Wizard

Reputation: 66388

Possible with pure HTML as well:

<a href="..." hidefocus="hidefocus">...</a>

And with JavaScript you can do that on all links:

window.onload = function WindowLoad(evt) {
   //hide focus:
   var arrLinks = document.getElementsByTagName("a");
   for (var i = 0; i < arrLinks.length; i++) {
       arrLinks[i].hideFocus = "true";
}

Upvotes: 5

Shikiryu
Shikiryu

Reputation: 10219

Despite my comment on your question,

You should keep them for accessibility.

You can find your CSS-trick here for this

(Anyway, you should keep them.)

Upvotes: 3

Linus Kleen
Linus Kleen

Reputation: 34632

You have to style the <a> like:

a {outline: none}

Upvotes: 17

danieelito
danieelito

Reputation: 51

    #myElement { outline: 0; }

Try this on your element, i dont now if is an image, div, button, link. But it works

Upvotes: 1

Related Questions