如何避免 firefox 在图像点击时添加叠加颜色?
how to avoid firefox to add overlay color on image click?
请看一下:
天蓝色的刚刚被点击了。仅限火狐。它只是 <li>
中的 <img>
,没有链接。为什么会变成天蓝色??在近 20 年的网络编程生涯中,这是我第一次看到这一点。它似乎与 ::selection 无关,也与 tap highlight 无关,所以我找不到有用的 css 规则来阻止它。 Firebug 在样式分析面板上没有显示任何有意义的内容。它也是页面中唯一以这种方式运行的元素。那到底是什么东西?如何避免?
您可以使用 user-select: none;
来避免它
The text of the element and sub-elements will not be able to be selected
备注
This feature is non-standard and is not on a standards track
请看一下:
天蓝色的刚刚被点击了。仅限火狐。它只是 <li>
中的 <img>
,没有链接。为什么会变成天蓝色??在近 20 年的网络编程生涯中,这是我第一次看到这一点。它似乎与 ::selection 无关,也与 tap highlight 无关,所以我找不到有用的 css 规则来阻止它。 Firebug 在样式分析面板上没有显示任何有意义的内容。它也是页面中唯一以这种方式运行的元素。那到底是什么东西?如何避免?
您可以使用 user-select: none;
The text of the element and sub-elements will not be able to be selected
备注
This feature is non-standard and is not on a standards track