css - 如何在 ADF 中使用 -moz-focus-inner 去除 firefox 中按钮的虚线轮廓

标签 css firefox oracle-adf jdeveloper

这里我使用的是 Oracle ADF。 我的按钮样式如下:

af|commandButton:text-only {
    background-image: none;
    width: auto;
    height: 30px;
    border: 1px solid #c4ced7;
    border-radius: 2px;
    font-size: 12px;
    font-weight: bold;
    color: #000000;
    text-align: center;
    padding: 2px 10px 3px 10px;
}

af|commandButton:text-only:focus {
    background-image: none;
    width: auto;
    outline: none;
    height: 30px;
    border: 1px solid #c4ced7;
    border-radius: 2px;
    font-size: 12px;
    font-weight: bold;
    color: #000000;
    text-align: center;
    padding: 2px 10px 3px 10px;
}

使用 CSS 代码段中指定的“outline:none;”删除焦点轮廓。 现在,焦点轮廓在除 firefox 之外的所有浏览器中都被删除。 根据诊断,我发现 firefox 使用“-moz-focus-inner”来渲染轮廓。

我在 CSS 中尝试了以下两种方法,但没有成功。

第一种方式:

button::-moz-focus-inner {
    border: 0;
}

第二种方式:

af|commandButton:text-only:focus::-moz-focus-inner,
af|commandButton:focus::-moz-focus-inner {
    border:0;
}

如何在 ADF 中为“-moz-focus-inner”指定样式?

最佳答案

我的 xul 程序也有同样的问题。重点是,按钮中隐藏了一些阴影 DOM,它有虚线边框。

我是这样实现的:

button *, button:focus *
{
    border: 0;
}

请记住,当按钮不处于 :focus 状态时,按钮内的元素具有透明边框。因此,您必须为这两种状态都清除它,或者只是在 :focus 处也将边框设置为透明。

希望对你也有帮助

关于css - 如何在 ADF 中使用 -moz-focus-inner 去除 firefox 中按钮的虚线轮廓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22064771/

相关文章:

html - 如何在 div 标签内制作超链接图像?

javascript - 防止两个具有相同选项的复选框出现重复选项

java - 使用 BC4J 在 Java 端处理 RAISE_APPLICATION_ERROR

java - 使用 oracle ADF 分页

java - Oracle Webcenter Spaces 和 Internet Explorer 9

javascript - 将不断变化的图像添加到主页

javascript - Fancybox.. 一张图片包含更多图片

css - 当我在 firefox 中检查元素时定位 joomla 文件

macos - Firefox NPAPI 插件在 VMware 上的 OSX 中损坏

linux - 使用 rpm 更新 firefox