如何从 html 输入/按钮中删除焦点矩形?

Thu*_*num 4 html css

type="button"我的页面上有这个输入按钮 ( ):

按钮

当我点击它时,周围有一个恼人的焦点矩形:

带有恼人焦点的按钮

我怎样才能删除它?

这是我的代码:

/*Buttons/Inputs*/
                    
.runInput {
   border-top: 1px solid #ffffff;
   background: #001cbd;
   background: -webkit-gradient(linear, left top, left bottom, from(#148bfa), to(#001cbd));
   background: -webkit-linear-gradient(top, #148bfa, #001cbd);
   background: -moz-linear-gradient(top, #148bfa, #001cbd);
   padding: 6.5px 13px;
   -webkit-border-radius: 12px;
   -moz-border-radius: 12px;
   border-radius: 12px;
   -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
   -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
   box-shadow: rgba(0,0,0,1) 0 1px 0;
   text-shadow: rgba(0,0,0,.4) 0 1px 0;
   color: #ffffff;
   font-size: 24px;
   font-family: Helvetica, Arial, Sans-Serif;
   text-decoration: none;
   vertical-align: middle;
   }
.runInput:hover {
   background: #001cbd;
   color: #d9d9d9;
   }
.runInput:active {
   background: #00046e;
   }
.runInput:focus {
   outline: 0;
}
Run Code Online (Sandbox Code Playgroud)
<input class="runInput" onclick="runCode();" type="button" value="Run">
Run Code Online (Sandbox Code Playgroud)

我试图添加outline: none;到我的 CSS 中,但没有成功。

提前感谢您的回答!

编辑:我改变了片段

Zah*_*hel 6

只需添加:

:focus {
    outline: 0 !important;
}
Run Code Online (Sandbox Code Playgroud)

它适用于所有元素。

或者

如果你只需要这个类然后添加

.runInput:focus {
    outline: 0 !important;
}
Run Code Online (Sandbox Code Playgroud)