【问题标题】:remove dotted line around the radio buttons in firefox删除Firefox中单选按钮周围的虚线
【发布时间】:2015-08-10 20:45:46
【问题描述】:

有一些帖子建议以下修复方法来删除单选按钮周围的虚线,如下所示:

 1)   input[type=radio]
  {
 &:focus
  {
-moz-appearance: none !important;
-moz-border-bottom-colors: transparent !important;
-moz-border-left-colors: transparent !important;
-moz-border-right-colors: transparent !important;
-moz-border-top-colors: transparent !important;
  }
  }

  2) input[type=radio]:-moz-focursing
   {
    outline : none;
     }

但是上面的两个修复对我不起作用。是否有任何其他的 css 要编写来删除 Firefox 中单选按钮周围不需要的边框。

提前致谢, 巴拉吉。

【问题讨论】:

  • -moz-appearance: none; 仅在边框由 GTK+ 主题产生时有效,在 Linux 系统上最常见。它通常不会在最常用的操作系统上使用标准配置来使用 GTK+。更广泛地说,Firefox 中的单选按钮似乎依赖于一些依赖于操作系统的功能,这可能解释了为什么这很难调试或解决。在没有测试的情况下,我建议在代码中保留-moz-appearance: none;,这样它就不会在 Linux 系统上中断。

标签: html css


【解决方案1】:

试试这个

 input[type="radio"] {
        outline: none;
    }

input[type="radio"]::-moz-focus-inner {
    outline: none;
}

【讨论】:

  • 嗨,谢谢斯里尼瓦斯,我刚试过你的答案,没用
  • 你能用小提琴重现你的问题吗?
  • 抱歉,在 firefox 中,焦点不会转到 fiddle 中的单选按钮
  • 这在 Firefox 94.0 上对我不起作用。无论如何,这些元素都会以 2px 的边框结束,这破坏了我的布局。
猜你喜欢
  • 2011-09-05
  • 1970-01-01
  • 2019-01-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-23
  • 2019-11-05
相关资源
最近更新 更多