如何在点击时删除"虚线边框"?

541*_*339 9 html javascript css

如你看到的

替代文字

我想以某种方式删除点击按钮后的虚线.任何想法如何?

谢谢

GUYS:这是我的CSS和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>
Run Code Online (Sandbox Code Playgroud)

似乎没有发生任何事情!

Lin*_*een 15

你需要设计风格<a>:

a {outline: none}
Run Code Online (Sandbox Code Playgroud)


kob*_*obe 6

使用以下代码

a:active
    {
    outline: none;
    }
Run Code Online (Sandbox Code Playgroud)

尝试其他浏览器也

a:focus
{
-moz-outline-style: none;
}
a:focus { outline:none }
Run Code Online (Sandbox Code Playgroud)


Sha*_*ard 5

也可以使用纯HTML:

<a href="..." hidefocus="hidefocus">...</a>
Run Code Online (Sandbox Code Playgroud)

使用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";
}
Run Code Online (Sandbox Code Playgroud)