html - 单击时按钮周围出现不需要的轮廓或边框

标签 html css button border outline

我的网站上有一个样式按钮。但是当我点击它时,它会创建一个不需要的边框或轮廓(我不知道是哪个)。我怎样才能删除那个边框?以下是与按钮相关的所有代码。

button {
    border: hidden;
    cursor: pointer;
    outline: none;
}
<button>this is my button</button>

最佳答案

使用这些 CSS 样式之一

a:active,
a:focus,
input,
input:active,
input:focus {
    outline: 0;
    outline-style:none;
    outline-width:0;
}  
a:active,
a:focus,
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
    border: none;
} 

:focus {outline:none;} ::-moz-focus-inner {border:0;}

完成 CSS 样式部分后,您可能还需要设置 IE-Emulator。更新您的 Web 应用程序 web.config 文件并包含以下键。

<system.webServer>
  <httpProtocol>
    <customHeaders>
      <clear />
      <add name="X-UA-Compatible" value="IE=7; IE=9; IE=8; IE=5;" />
    </customHeaders>
  </httpProtocol>

</system.webServer>

关于html - 单击时按钮周围出现不需要的轮廓或边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4524180/

相关文章:

javascript - 在表格内的链接悬停上显示图像

javascript - 为什么这个类不应用于图像?

PHP 正则表达式 HTML - 提取 URL

jquery - 更改移动设备的行顺序

JavaScript 滚动以缩小 Logo 和菜单栏

css - 删除shinydashboardPlus中的左侧边栏(仅保留右侧)

swift - 单击触发打开另一个 VC 的按钮时如何将按钮 sender.tag 传递给另一个 VC

css - 我可以使用 CSS 渲染这种下拉菜单吗?

javascript - 评估语句中的按钮文本

swift - 我想在按钮上使用 bool,如果我单击 imageview 的按钮图像已更改,如果再次单击按钮,则使用 Swift 反转图像