2010-12-07 51 views
9

正如你可以看到如何在点击时删除“虚线边框”?

alt text

我想以某种方式删除虚线后的按钮已被clicked.Any的想法如何?

感谢

球员:这是我的CSS ANSD HTML的当前状态,但还是没有用:

.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> 

似乎没有任何要发生的事情!

+1

我看不到它。 – 2010-12-07 08:24:12

+2

您应该保持它们的可访问性。 – Shikiryu 2010-12-07 08:24:21

+0

伙计们,我已经编辑过这个帖子..还没有用! – 5416339 2010-12-07 08:44:19

回答

5

可能与纯HTML以及:

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

使用JavaScript,你可以做到这一点在所有链接:

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

试试这个对你的元素,我现在不是如果是图像,div,按钮,链接。但是,它的工作原理

14

你要的风格的<a>这样的:

a {outline: none} 
6

使用下面的代码

a:active 
    { 
    outline: none; 
    } 

尝试其他浏览器也

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

A.No-大纲:如果你想保持活跃,焦点轮廓,但隐藏在点击一个链接,你可以在CSS中添加{外形风格:无;}

和使用脚本:

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

你必须悬停befor点击,所以它做的工作。