gpt4 book ai didi

css - Firefox userChrome.css 窗口焦点选择器

转载 作者:行者123 更新时间:2023-11-28 17:11:51 24 4
gpt4 key购买 nike

当整个浏览器窗口失去焦点时,我可以在 userChrome.css 中使用 CSS 选择器来更改 Firefox 的文本颜色吗?

我试过:

window:focus element { color: #aaa; }    /* does nothing */
window:active element { color: #aaa; } /* only when something's being clicked */
window:hover element { color: #aaa; } /* only when the cursor is over the window */
window[focus] element { color: #aaa; } /* wishful thinking--doesn't work */
window[active="true"] element { color: #aaa; } /* documented to work... */

还是我一直在使用 Javascript?如果是这样,是否有我可以放入该脚本的 userChrome.js

最佳答案

解决了!

根据 https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-window-inactive ,此功能已更改。

现在您可以使用:

element:-moz-window-inactive { color: #aaa; }

和:

element:not(-moz-window-inactive) { color: #aaa; }

根据 Firefox 窗口是否聚焦更改 CSS 样式。

关于css - Firefox userChrome.css 窗口焦点选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29085855/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com