点击按钮时,按钮会在短时间内将其背景颜色更改为半透明的灰色。我想禁用此行为或自己设置颜色。
如果我没有同时设置背景颜色和图像,我不会太在意它:当颜色改变时,图像保持不变并且看起来很难看。
我试过 :active、:hover、:active:hover,但都没有成功。 -webkit-tap-highlight-color 在这里不适用,因为它不是 Webkit 浏览器(但我已经试过了......)。 这不是虚线轮廓的问题,我已经能够将其删除。
这里有一些代码供引用:
<style>
#that_button {
background: url(https://www.google.com/images/srpr/logo11w.png) 130px .3em no-repeat;
background-size: auto 1.5em;
background-color: #66ccff;
border: none;
height: 2em;
width: 200px;
}
</style>
<button id="that_button">Hello</button>
最佳答案
高亮样式定义在那里:https://hg.mozilla.org/mozilla-central/file/f003c386c77a/mobile/android/themes/core/content.css#l309 ,并且它不能被覆盖。唯一的“解决方案”是使用 div 或其他与源中的选择器不匹配的元素,因为它们不会突出显示(尽管这不是语义 html)。
我已经能够联系开发人员,结果如下:https://bugzilla.mozilla.org/show_bug.cgi?id=936593 ,因此应该修复该行为。很抱歉在我找到答案后延迟提供答案。
关于android - 在 Firefox for Android 中删除元素突出显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19842536/